VHDMount is a new tool from Microsoft that allows you to connect (or mount) a virtual hard disk to your host operating system as if it were a seperate physical disk.  This can be very useful in accessing files in the virtual hard disk or for performing backups.  I’ve used it to access files when I didn’t have file sharing configured between the host and guest operating systems.

VHDMount is included in Virtual Server 2005 R2 SP1, which can be downloaded from  here.  Registration is required before downloading.

Once installed, VHDMount can be found in the VHDMount directory where Virtual Server was installed.  Usually that would be C:\Program Files\Microsoft Virtual Server\Vhdmount.

VHDMount is a command line utility. 

Use the following command: VHDMount /p [/f] VHDFileName.

The /p parameter will connect the virtual hard disk specified in VHDFileName to the host operating system. On Windows XP it will automatically mount and assign the next available drive letter to all the partitions on the virtual hard disk. On Windows 2003 it will not mount the partitions on the virtual hard disk so you have to use the disk management console to assign drive letters or mount point in order to access the data.

On Windows Server 2003 you can use the following command:
VHDMount /m [/f] VHDFileName [DriveLetter].

The /m parameter can only be used on Windows Server 2003 and will mount all partitions on the virtual hard disk and use DriveLetter for the first partition. The rest of the partitions will get assigned incrementing drive letters as appropriate. DriveLetter is optional and if not provided the behavior is the same as using /p on Windows XP.

The /f parameter will mount the virtual hard disk without creating an Undo Disk.

To unmount the virtual hard disk use:
VHDMount /u VHDFileName [/c | /d].

The /c parameter will commit all changes that were stored in the Undo Disk. It is only applicable if the virtual hard disk was mounted without the /f parameter.

The /d parameter will discard all changes to the mounted disk. It is only applicable if the virtual hard disk was mounted without the /f parameter.

For questions or comments about this post, please send an email to  blog@cerkitek.com.