One of the good things Microsoft puts in Windows 7 for virtualization is the native support of VHD, which stands for Virtual Hard Disk. If you have used Virtual PC before, VHD shouldn’t be a stranger to you. Since Windows 7, you can easily create, attach, detach VHD files right in the system without using a Virtual platform. You can simply treat a VHD file as a removable disk, like your USB external storage.
There are two ways of doing it, one on the command line and the other uses GUI. Depending on which one you prefer, they are pretty much do the same thing with the same result.
Diskpart – command line
Open an administrator command window. The following are the diskpart commands to create a dynamic VHD that is 25G maximum size, saved in c:\vhd folder. It also formats the partition to NTFS in quick mode, and assigns a driver letter V.
CREATE VDISK FILE=C:\VHD\<filename>.vhd MAXIMUM=25000 TYPE=EXPANDABLE
SELECT VDISK FILE=C:\VHD\<filename>.vhd
CREATE PARTITION PRIMARY
FORMAT FS=NTFS QUICK
Note that the command diskpart in Windows 7 adds an additional option in Create named vdisk that wasn’t existed in the previous Windows.
Disk Management – GUI option
In Disk Management, click Action box from the top menu, and you can choose either Create or Attach VHD from the menu.
When creating a VHD, you need to specify the file name with location, size, and the format. It’s recommended using Fixed size from the performance stand point of view, but usually if you want to quick, you can always choose Dynamic which you can still change later on.
We will be covering more on this topic, so stay tuned.