How to make vhd file? [closed]











up vote
-1
down vote

favorite












I have made a small program that creates a virtual disk. It invokes the shell and runs diskpart which in turn performs a mini-script, such as: "create vdisk file=MyDisk.vhd, etc.". Diskpart runs in a separate thread. Of course.



Is it possible to create a virtual disk directly from code without going through the shell? More generally, there is a .NET library for handling vhd files (or vhdx)? The languages I use are VB and C #.
Alternatively, can I use the Windows API? If so, which one?










share|improve this question













closed as off-topic by DavidPostill Nov 28 at 13:01


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – DavidPostill

If this question can be reworded to fit the rules in the help center, please edit the question.













  • If you are making this to just fill a specific usecase, look into what already exists. For example sysinternals disk2vhd may be what you're after. It converts a disk in your pc to a vhd so you can virtualize the disk and use in a VM.
    – LPChip
    Nov 28 at 13:18










  • for David: I do not understand. My problem is specific. What's not right exactly? If I write only: "Is it possible to create a virtual disk directly from code without going through the shell?" can it be okay?
    – Luciano
    Nov 28 at 13:33










  • for LPChip: No. I'm not looking for this. disk2vhd clones physical disks into virtual disks. I want to create a virtual disk from my code, so I also learn something new because I do not know how to do it. Unless you refer to the source of disk2vhd (but are there sources?), however it would be written in C ++ and therefore it is not for me!
    – Luciano
    Nov 28 at 13:34






  • 1




    This might be what you are looking for - github.com/discutils/discutils, another to consider using is powershell as you can execute this via c# docs.microsoft.com/en-us/powershell/module/hyper-v/… , blogs.msdn.microsoft.com/kebab/2014/04/28/…
    – CraftyB
    Nov 28 at 13:45










  • Hello, the first link is not good, because I need a binary executable, but the second one is very interesting and maybe that's exactly what I'm looking for. I also found a COM+ library that could do for me: "IVMVirtualServer", it is possible to refer to it in the COM style, but I did not understand where it physically resides (Google do not help in this case!). Thank you.
    – Luciano
    Nov 28 at 14:45















up vote
-1
down vote

favorite












I have made a small program that creates a virtual disk. It invokes the shell and runs diskpart which in turn performs a mini-script, such as: "create vdisk file=MyDisk.vhd, etc.". Diskpart runs in a separate thread. Of course.



Is it possible to create a virtual disk directly from code without going through the shell? More generally, there is a .NET library for handling vhd files (or vhdx)? The languages I use are VB and C #.
Alternatively, can I use the Windows API? If so, which one?










share|improve this question













closed as off-topic by DavidPostill Nov 28 at 13:01


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – DavidPostill

If this question can be reworded to fit the rules in the help center, please edit the question.













  • If you are making this to just fill a specific usecase, look into what already exists. For example sysinternals disk2vhd may be what you're after. It converts a disk in your pc to a vhd so you can virtualize the disk and use in a VM.
    – LPChip
    Nov 28 at 13:18










  • for David: I do not understand. My problem is specific. What's not right exactly? If I write only: "Is it possible to create a virtual disk directly from code without going through the shell?" can it be okay?
    – Luciano
    Nov 28 at 13:33










  • for LPChip: No. I'm not looking for this. disk2vhd clones physical disks into virtual disks. I want to create a virtual disk from my code, so I also learn something new because I do not know how to do it. Unless you refer to the source of disk2vhd (but are there sources?), however it would be written in C ++ and therefore it is not for me!
    – Luciano
    Nov 28 at 13:34






  • 1




    This might be what you are looking for - github.com/discutils/discutils, another to consider using is powershell as you can execute this via c# docs.microsoft.com/en-us/powershell/module/hyper-v/… , blogs.msdn.microsoft.com/kebab/2014/04/28/…
    – CraftyB
    Nov 28 at 13:45










  • Hello, the first link is not good, because I need a binary executable, but the second one is very interesting and maybe that's exactly what I'm looking for. I also found a COM+ library that could do for me: "IVMVirtualServer", it is possible to refer to it in the COM style, but I did not understand where it physically resides (Google do not help in this case!). Thank you.
    – Luciano
    Nov 28 at 14:45













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have made a small program that creates a virtual disk. It invokes the shell and runs diskpart which in turn performs a mini-script, such as: "create vdisk file=MyDisk.vhd, etc.". Diskpart runs in a separate thread. Of course.



Is it possible to create a virtual disk directly from code without going through the shell? More generally, there is a .NET library for handling vhd files (or vhdx)? The languages I use are VB and C #.
Alternatively, can I use the Windows API? If so, which one?










share|improve this question













I have made a small program that creates a virtual disk. It invokes the shell and runs diskpart which in turn performs a mini-script, such as: "create vdisk file=MyDisk.vhd, etc.". Diskpart runs in a separate thread. Of course.



Is it possible to create a virtual disk directly from code without going through the shell? More generally, there is a .NET library for handling vhd files (or vhdx)? The languages I use are VB and C #.
Alternatively, can I use the Windows API? If so, which one?







visual-studio






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 28 at 13:00









Luciano

216




216




closed as off-topic by DavidPostill Nov 28 at 13:01


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – DavidPostill

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by DavidPostill Nov 28 at 13:01


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – DavidPostill

If this question can be reworded to fit the rules in the help center, please edit the question.












  • If you are making this to just fill a specific usecase, look into what already exists. For example sysinternals disk2vhd may be what you're after. It converts a disk in your pc to a vhd so you can virtualize the disk and use in a VM.
    – LPChip
    Nov 28 at 13:18










  • for David: I do not understand. My problem is specific. What's not right exactly? If I write only: "Is it possible to create a virtual disk directly from code without going through the shell?" can it be okay?
    – Luciano
    Nov 28 at 13:33










  • for LPChip: No. I'm not looking for this. disk2vhd clones physical disks into virtual disks. I want to create a virtual disk from my code, so I also learn something new because I do not know how to do it. Unless you refer to the source of disk2vhd (but are there sources?), however it would be written in C ++ and therefore it is not for me!
    – Luciano
    Nov 28 at 13:34






  • 1




    This might be what you are looking for - github.com/discutils/discutils, another to consider using is powershell as you can execute this via c# docs.microsoft.com/en-us/powershell/module/hyper-v/… , blogs.msdn.microsoft.com/kebab/2014/04/28/…
    – CraftyB
    Nov 28 at 13:45










  • Hello, the first link is not good, because I need a binary executable, but the second one is very interesting and maybe that's exactly what I'm looking for. I also found a COM+ library that could do for me: "IVMVirtualServer", it is possible to refer to it in the COM style, but I did not understand where it physically resides (Google do not help in this case!). Thank you.
    – Luciano
    Nov 28 at 14:45


















  • If you are making this to just fill a specific usecase, look into what already exists. For example sysinternals disk2vhd may be what you're after. It converts a disk in your pc to a vhd so you can virtualize the disk and use in a VM.
    – LPChip
    Nov 28 at 13:18










  • for David: I do not understand. My problem is specific. What's not right exactly? If I write only: "Is it possible to create a virtual disk directly from code without going through the shell?" can it be okay?
    – Luciano
    Nov 28 at 13:33










  • for LPChip: No. I'm not looking for this. disk2vhd clones physical disks into virtual disks. I want to create a virtual disk from my code, so I also learn something new because I do not know how to do it. Unless you refer to the source of disk2vhd (but are there sources?), however it would be written in C ++ and therefore it is not for me!
    – Luciano
    Nov 28 at 13:34






  • 1




    This might be what you are looking for - github.com/discutils/discutils, another to consider using is powershell as you can execute this via c# docs.microsoft.com/en-us/powershell/module/hyper-v/… , blogs.msdn.microsoft.com/kebab/2014/04/28/…
    – CraftyB
    Nov 28 at 13:45










  • Hello, the first link is not good, because I need a binary executable, but the second one is very interesting and maybe that's exactly what I'm looking for. I also found a COM+ library that could do for me: "IVMVirtualServer", it is possible to refer to it in the COM style, but I did not understand where it physically resides (Google do not help in this case!). Thank you.
    – Luciano
    Nov 28 at 14:45
















If you are making this to just fill a specific usecase, look into what already exists. For example sysinternals disk2vhd may be what you're after. It converts a disk in your pc to a vhd so you can virtualize the disk and use in a VM.
– LPChip
Nov 28 at 13:18




If you are making this to just fill a specific usecase, look into what already exists. For example sysinternals disk2vhd may be what you're after. It converts a disk in your pc to a vhd so you can virtualize the disk and use in a VM.
– LPChip
Nov 28 at 13:18












for David: I do not understand. My problem is specific. What's not right exactly? If I write only: "Is it possible to create a virtual disk directly from code without going through the shell?" can it be okay?
– Luciano
Nov 28 at 13:33




for David: I do not understand. My problem is specific. What's not right exactly? If I write only: "Is it possible to create a virtual disk directly from code without going through the shell?" can it be okay?
– Luciano
Nov 28 at 13:33












for LPChip: No. I'm not looking for this. disk2vhd clones physical disks into virtual disks. I want to create a virtual disk from my code, so I also learn something new because I do not know how to do it. Unless you refer to the source of disk2vhd (but are there sources?), however it would be written in C ++ and therefore it is not for me!
– Luciano
Nov 28 at 13:34




for LPChip: No. I'm not looking for this. disk2vhd clones physical disks into virtual disks. I want to create a virtual disk from my code, so I also learn something new because I do not know how to do it. Unless you refer to the source of disk2vhd (but are there sources?), however it would be written in C ++ and therefore it is not for me!
– Luciano
Nov 28 at 13:34




1




1




This might be what you are looking for - github.com/discutils/discutils, another to consider using is powershell as you can execute this via c# docs.microsoft.com/en-us/powershell/module/hyper-v/… , blogs.msdn.microsoft.com/kebab/2014/04/28/…
– CraftyB
Nov 28 at 13:45




This might be what you are looking for - github.com/discutils/discutils, another to consider using is powershell as you can execute this via c# docs.microsoft.com/en-us/powershell/module/hyper-v/… , blogs.msdn.microsoft.com/kebab/2014/04/28/…
– CraftyB
Nov 28 at 13:45












Hello, the first link is not good, because I need a binary executable, but the second one is very interesting and maybe that's exactly what I'm looking for. I also found a COM+ library that could do for me: "IVMVirtualServer", it is possible to refer to it in the COM style, but I did not understand where it physically resides (Google do not help in this case!). Thank you.
– Luciano
Nov 28 at 14:45




Hello, the first link is not good, because I need a binary executable, but the second one is very interesting and maybe that's exactly what I'm looking for. I also found a COM+ library that could do for me: "IVMVirtualServer", it is possible to refer to it in the COM style, but I did not understand where it physically resides (Google do not help in this case!). Thank you.
– Luciano
Nov 28 at 14:45















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

What is the story behind “peach kanji” 桃?

Pontes Indestrutíveis

Padre Marcelo Rossi