Freigeben über


How to mount a VHD under Vista by double clicking

[for Windows 7 read this post

In my daily work I use a lot of Virtual PC images (VHD) so my host Vista system will stay clean of beta and test software. To get to the files I stored inside a Virtual PC images I normally start the Virtual PC and drag and drop them to my host system. This can be more efficient using the command line tool VHDMount. You mount the VHD and can read and write the files like a normal hard disk in your host system. By importing a small registry file you don’t need the command line anymore and can mount and unmount (dismount) the VHD.

VHD Mount

This is what you need to do to mount a VHD inside Vista by double clicking.

  1. Microsoft Virtual PC
    1. Download "Microsoft Virtual PC 2007" from the following link:
      https://www.microsoft.com/windows/downloads/virtualpc/default.mspx
    2. Install "Microsoft Virtual PC 2007" normally by double clicking.
  2. Microsoft VHD Mount
    1. VHD Mount is part of "Microsoft Virtual Server 2005 R2 SP1".
    2. Download "Microsoft Virtual Server 2005 R2 SP1 - Enterprise Edition" from the following link:
      https://www.microsoft.com/downloads/details.aspx?familyid=bc49c7c8-4840-4e67-8dc4-1e6e218acce4&displaylang=en
    3. Install (using the custom setup option) only the VHD Mount tool.
  3. Double clicking VHD integration in Vista
    1. Create a text file and rename it to vhdmount.reg.

    2. Edit the vhdmount.reg file and add the following lines:

      Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD][HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell]@="Mount"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount][HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount\command]@="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /c \"%1\""[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Mount][HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Mount\command]@="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /p \"%1\""[HKEY_CLASSES_ROOT\.vhd]@="Virtual.Machine.HD"

    3. Run the vhdmount.reg file.

Comments

  • Anonymous
    May 07, 2008
    Just swinging by to say Hi and thanks for posting this tip -- greatly appreciated!
  • Anonymous
    June 05, 2008
    The comment has been removed
  • Anonymous
    June 16, 2008
    Instructions seem missing something.Created vhdmount.req file but cannot run it. It is not an executable file?Also the comments by PM indicate the the registry key settings should be different.Is this correct?
  • Anonymous
    June 16, 2008
    Dermott - the extension of the registry file is .REG, it is only difficult to read by the underline.I updated the post and added the dismount command /c option.
  • Anonymous
    September 13, 2008
    First, thanks for the info, very handy and to the point but I've noticed that with each mount a new device is discovered and a newMS Virtual Server SCSI Disk Deviceentry is made in the registryHKEY_LOCAL_MACHINESYSTEMCurrentControlSetEnumSCSIDisk&Ven_MS&Prod_Virtual_Server&Rev_1.0Or you can see them in the device manager using commands or batch file.SET DEVMGR_SHOW_NONPRESENT_DEVICES=1START DEVMGMT.MSCThen in the view menu selecting Show hiddenNot that it matters too much in my case but someone doing this a lot is going to end up with lots of hidden no more used device listings in the registry. Just a heads up. Thanks again.
  • Anonymous
    September 13, 2008
    Just add to this, it doesn't seem to redetect the device when don't dismount and restart the computer and mount again.
  • Anonymous
    September 13, 2008
    I guess I should have tried this some more, it doesn't redetect everytime the same vhd is mounted but it did a couple of times.
  • Anonymous
    September 29, 2008
    I'm just wondering, how do I actually access the disc once I've mounted it?
  • Anonymous
    September 29, 2008
    You can access your files like on a normal hard drive, for example D: or E: (depending on your configuration). You shoed see a new drive letter.
  • Anonymous
    October 18, 2008
    There is only one additional action required if you have UAC enabled - go to the location of vhdmount.exe and in compatibility properties check 'Run as the administrator' to make this working.
  • Anonymous
    December 20, 2008
    Lately I have been running into the following error message when unplugging a VHD file that I mounted
  • Anonymous
    January 11, 2009
    I recommend using the /f switch so that an undo disk does not get created by default. All changes are then written directly to disk, like you would expect.
  • Anonymous
    January 16, 2009
    The comment has been removed
  • Anonymous
    January 19, 2009
    The comment has been removed
  • Anonymous
    January 20, 2009
    I tried this and followed all the instructions carefully. Everything appears to work (no errors) but nothing happens (no new hard drive letter.)So, I'm loading a full vpc install to see if I can access my vhd once it's up and running.
  • Anonymous
    March 01, 2009
    I get the same problem, here is the issue, not sure how to fix.  This drive i'm mounting (my backup from vista) is greater than 128GB (even if the file isn't the file thinks it is...) so it has be mounted as a scsi virtual device with vhdmount, i can do this fine within virtual server, but no joy using vhdmount, any hidden options to associate it with virtual scsi controller?
  • Anonymous
    March 09, 2009
    Windows 7 has native support for VHD mounting (and booting). In my earlier blog post about VHD mounting
  • Anonymous
    April 14, 2009
    The comment has been removed
  • Anonymous
    May 08, 2009
    Try manually installing both INF files in teh vhdmount folder through add hardware... Then after mounting the drive (may have to unmount then remount), go into device manager and look for the warning symbol under Disk drives. Right click, update driver, and point it to the directory holding the INF files.
  • Anonymous
    November 01, 2009
    Just what i was looking for.....thanks!!!