Thursday, August 31, 2006 5:30 PM
BrianR
A Quick Tour of VHDMount
As I mentioned in my previous post, Beta 2 of Microsoft Virtual Server 2005 R2 SP1 is out. One feature that others and I have wanted for a long time is the ability to mount a virtual hard disk (VHD) file without having to start a VM.
The VHDMount utility is a command-line tool that's automatically installed when you install the beta. However, if you look at the readme, you can extract it and install just this tool.
How doyou mount a disk? Well, before you get too eager, a few of notes:
- It's a beta. For now, I would keep backups of my important VHDs before I mount them—just in case.
- If you're running Windows XP, you'll have to first "plug-in" the virtual hard drive and then mount it via the Windows Disk Management tools.
That said, I was unable to get a drive plugged in on my XP box.
- If you're running Windows Server 2003 (and supposedly Longhorn Server and/or Vista), you can both plug as well as mount (which effectively will plug the drive in and then mount it). When you choose to mount the drive, VHDMount will pick the next free drive letter. However, you can specify a drive letter if you wish.
- When you mount a drive, a warning dialog box will appear (see Figure 2 below). I'm assuming at this point this is a side affect of the beta.
Figure 1 displays the command-line to mount mount a VHD with the drive letter X: on a x86 Windows Server 2003 SP1 box.
Figure 1: Command to mount a VHD.
Note: You don't specify the colon, just the letter.
Figure 2 displays the warning dialog box you'll receive each time you mount a drive.
Figure 2: Warning Dialog
Figure 3 displays the results of the command issued in Figure 1.

Figure 3: Successful mount of a VHD.
Figure 4 displays the newly mounted drive in the Disk Management MMC.
Figure 4: The VHD mounted in Disk Management
Figure 5 shows the root of the drive in Windows Explorer.
Figure 5: The VHD mounted and accessible via Windows Explorer.
Finally, for the curious, yes, the drive is read-write. However, remember that Microsoft doesn't currently support offline patching of "real" machines and thus doesn't (yet?) support offline patching of virtual machines either.
Figure 6 shows the root of the drive in Windows Explorer with two files deleted from the root (compare Figure 6 to Figure 5).
Figure 6: The VHD mounted and accessible via Windows Explorer with two files deleted from the root.
When you're all done with the drive, you unmount it using the /u switch (see Figure 7):
Figure 7: Unmounting a VHD.
Figure 8 displays the command-line results of the unmount.
Figure 8: Successful unmounting of a VHD.
End of line.
Filed under: Virtualization Technologies