Error DataBase-One Place all Solutions Forums Blog Glossary    Contact Us
Search  
   
Browse by Category
Error DataBase-One Place all Solutions .: Virtualization .: How to VHD files with VHDMount

How to VHD files with VHDMount

Virtual Server 2005 R2 SP1 includes a tool called VHDmount that allows you to mount a virtual hard disk (which in fact is a .VHD file) directly on your host operating system.

After installing Virtual Server R2 SP1 on your server, you can access VHDMount from the %Program Files%\Microsoft Virtual Server\Vhdmount folder.
VHDMount is provided as a command line tool. You can perform various tasks by either running it directly from the Command Line, or by using simple batch files that do what you need to do. Some of the capabilities of VHDMount are:

/p - Plugs in the specified VHD as a virtual disk device without mounting the volume.

/m - Plugs in the specified VHD as a virtual disk device and mounts the volume.

/f - Performs the specified operation without creating an Undo Disk. This parameter is applicable for /p and /m. All changes to the mounted disk are directly written to the specified VHD.

/u - Unplugs the virtual disk device for the specified VHDFileName.

/c - Updates the original VHD with all changes that were stored in the Undo Disk anddeletes the Undo Disk after unplugging the disk. This parameter is only applicable if the VHD was mounted without using /f.

/d - Discards all changes to the mounted disk and deletes the Undo Disk after unplugging the disk. This parameter is only applicable if the VHD was mounted without using /f.

/q - Displays the disk name of the mounted virtual disk device for the specified VHDFileName.

VHDFileName - VHD name including full path.

DriveLetter - Optional parameter for /m option. If drive letter is specified the volumes are mounted starting at the specified drive letter. If drive letter is not specifiedit is automatically assigned.

All - Applies the operation on all mounted virtual disk devices. This parameter is applicable for /u and /q.

By default, VHDMount creates an Undo Disk in current user's temporary folder. All changes to the mounted disk are written to this Undo Disk. Use /c to commit or /d to discard these changes at the time of unplugging the disk device. Use /f option to mount a VHD without an Undo Disk.

Examples:
VHDMOUNT /p [/f] VHDFileName
VHDMOUNT /m [/f] VHDFileName [DriveLetter]
VHDMOUNT /u [/c | /d] VHDFileName | All
VHDMOUNT /q VHDFileName | All

 

Integrating VHDMount in the Explorer context menu

Ben Armstrong, a Program manager on the core virtualization team at Microsoft, has published a neat registry trick that allows you to mount VHDs by just double clicking on them. By creating a .reg file with the following contents:

Double click on the .reg file (to load it into your registry) you will be able to double click a VHD to mount it, and right click on it to dismount it.

Windows will auto-install the correct driver and allow you to see the .VHD file as a new hard drive.

         

Issues with Windows Vista

Two notes about using this trick with Windows Vista:

  1. For some reason 'double click' does not work in Windows Vista. The only way around it is to right-click on the .VHD file and select "Plug in".


     
  2. VHDMount needs to run 'As Administrator'. You can either disable UAC or, to get this to work with UAC enabled, you will need to configure VHDMount.exe, go to the Compatibility Mode tab, and check "Run this program as an administrator".

When you're done working with the mounted .VHD file you can right-click it and either choose to commit changes, or not.

Get the functionality of VHDMount without installing Virtual Server

If you need VHDMount but you don’t need or want to install Virtual Server you can install only the VHDMount components, use the Custom option in the Virtual Server R2 SP1 installer and clear all components except VHDMount.


How helpful was this article to you?

Related Articles

article How to Automated cleanup of Temp files, Internet files, downloaded files, recycle bin using CLEANMGR.EXE Tool(XP)
Syntax CLEANMGR option Options ...

(No rating)  3-7-2008    Views: 201   
article How to Compare the contents of two files or sets of files using FC.EXE
Compare the contents of two files or sets...

(No rating)  3-7-2008    Views: 127   
article How to restore Files to a Different Computer
To be able to use encrypted files on a...

(No rating)  5-21-2008    Views: 62   

User Comments

Add Comment
No comments have been posted.