How to Create and mount VHD files in Windows 7?

Microsoft's Virtual PC creates its virtual machine hard drives in VHD files, and Windows 7 can now mount these directly so you can access them in the host system. Click Start, type diskmgmt.msc and press Enter, then click Action > Attach VHD and choose the file you'd like to mount. It will then appear as a virtual drive in Explorer and can be accessed, copied or written just like any other drive.

Click Action > Create VHD and you can now create a new virtual drive of your own (right-click it, select Initialize Disk, and after it's set up right-click the unallocated space and select New Simple Volume to set this up). Again, you'll be left with a virtual drive that behaves just like any other, where you can drag and drop files, install programs, test partitioning software or do whatever you like. But it's actually just this VHD file on your real hard drive which you can easily back up or share with others. Right-click the disk (that's the left-hand label that says "Disk 2" or whatever) and select Detach VHD to remove it.

The command line DISKPART utility has also been upgraded with tools to detach a VHD file, and an EXPAND command to increase a virtual disk's maximum size. Don't play around with this unless you know what you're doing, though - it's all too easy to trash your system.

No comments: