Welcome to MSDN Blogs Sign in | Join | Help

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:
      http://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:
      http://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.
Published Wednesday, March 26, 2008 4:51 PM by cschotte
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: How to mount a VHD under Vista by double clicking

Wednesday, May 07, 2008 10:47 PM by Wes

Just swinging by to say Hi and thanks for posting this tip -- greatly appreciated!

# re: How to mount a VHD under Vista by double clicking

Thursday, June 05, 2008 6:26 PM by Almost right

You need to add a /d or /c to the dismount command for discard or commit changes so the line should be:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount\command]

@="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /d \"%1\""

For dismount changes or

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount\command]

@="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /c \"%1\""

For commit changes

# re: How to mount a VHD under Vista by double clicking

Monday, June 16, 2008 7:02 PM by Dermott Renner

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?

# re: How to mount a VHD under Vista by double clicking

Tuesday, June 17, 2008 4:05 AM by cschotte

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.

# re: How to mount a VHD under Vista by double clicking

Sunday, September 14, 2008 2:38 AM by KComp

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 new

MS Virtual Server SCSI Disk Device

entry is made in the registry

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SCSI\Disk&Ven_MS&Prod_Virtual_Server&Rev_1.0

Or you can see them in the device manager using commands or batch file.

SET DEVMGR_SHOW_NONPRESENT_DEVICES=1

START DEVMGMT.MSC

Then in the view menu selecting Show hidden

Not 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.

# re: How to mount a VHD under Vista by double clicking

Sunday, September 14, 2008 3:11 AM by KComp

Just add to this, it doesn't seem to redetect the device when don't dismount and restart the computer and mount again.

# re: How to mount a VHD under Vista by double clicking

Sunday, September 14, 2008 3:31 AM by KComp

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.

# re: How to mount a VHD under Vista by double clicking

Tuesday, September 30, 2008 2:30 AM by WW

I'm just wondering, how do I actually access the disc once I've mounted it?

# re: How to mount a VHD under Vista by double clicking

Tuesday, September 30, 2008 2:49 AM by cschotte

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.

# re: How to mount a VHD under Vista by double clicking

Saturday, October 18, 2008 5:23 PM by James

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.

# Vhdmount on Vista

Saturday, December 20, 2008 3:17 PM by Dennis Mulder - Convert.ToString(My.Core.Dump)

Lately I have been running into the following error message when unplugging a VHD file that I mounted

# re: How to mount a VHD under Vista by double clicking

Sunday, January 11, 2009 2:01 PM by b2dac

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.

# re: How to mount a VHD under Vista by double clicking

Friday, January 16, 2009 11:32 AM by Bryan

This is Frustrating!!  Using best practices..running as a restricted user..meaning I have to run as everything as administrator with domain admin credentials.  You can't mount as a restricted user..so I open command prompt and type my administrator credentials.  I added C:\\Program Files\\Microsoft Virtual Server\\Vhdmount to my paths in system variables.

So I run, vhdmount /m /f WCUeBriefcase.Staging.vhd K  As and administrator and I get this message below..and It never mounts!!

The Virtual Hard Disk is successfully plugged in as a virtual disk device. However, not all the volumes on the disk were successfully mounted. Use Disk Manager

to mount the volumes.

My God why can't Microsoft just get it together and make a nice tool like vmware. It's like you have to pull teeth for everything you do.  Sorry I had to vent.

If anyone can help me out..much appreciated.

Regards,

Bryan

# re: How to mount a VHD under Vista by double clicking

Tuesday, January 20, 2009 6:11 AM by win 7

trying to do this under windows 7 but it's always giving me an message, something like:

The specified virtual hard disk <snip> is being plugged in using the default Undo Disk option.  Use /c to commit or /d to discard the changes to the mounted disk.

Then there was one more line that I couldn't read before the thing cmd window disappeared, but not drives that I could see.

# re: How to mount a VHD under Vista by double clicking

Tuesday, January 20, 2009 8:22 PM by Jeff

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.

# re: How to mount a VHD under Vista by double clicking

Sunday, March 01, 2009 2:32 PM by Bob Dole

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?

# VHD mounting under Windows 7

Monday, March 09, 2009 10:31 AM by Clemens Schotte's Blog

Windows 7 has native support for VHD mounting (and booting). In my earlier blog post about VHD mounting

# re: How to mount a VHD under Vista by double clicking

Tuesday, April 14, 2009 8:40 AM by Jez

Getting similar issues with Vista x64.  using /m and /f VHDMount says the drive has been plegged in ans has been mounted but no new drive appears.  In computer management the drive is shown as active but with no drive letter and the only option allowed for it is to delete the volume - cant assign a drive letter to it?

Anyone have any ideas?

# re: How to mount a VHD under Vista by double clicking

Friday, May 08, 2009 2:05 PM by Derek

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.

# Visual Studio 2010 Beta 1: How to Install

Friday, May 29, 2009 1:57 PM by Paul Cornell

# re: How to mount a VHD under Vista by double clicking

Sunday, November 01, 2009 10:07 AM by sampath

Just what i was looking for.....thanks!!!

# re: How to mount a VHD under Vista by double clicking

Tuesday, November 10, 2009 5:18 PM by Ron

Please help, have tried everything to open my 2008 vhd file with not success.  NT Backup and Restore reports unrecognizable data.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker