Saturday, January 05, 2008

Tell me a VHDMount Story (Installing just VHDMount on Windows Vista and then mounting a VHD as a drive letter...)

Here's the story...

I had a VHD I downloaded from Microsoft that I wanted to browse. All I wanted to do was check if a few files were on the VHD's. That's it.

I felt installing Virtual PC 2007 to do this was overkill. Again all I wanted to do was mount the VHD as a drive letter and quickly browse it... VHDMount from Virtual Server 2005 R2 SP1 sounded like just the thing. Should be quick and easy, right?

In the end, it wasn't all that quick nor easy, but now that I'm setup it will be MUCH faster and easier next time (mounting a VHD will be just a double click away now).

To help others possibly in the same boat, I've jotted down some notes and related resources.


Intent:

Be able to mount a VHD on Vista and browse it like any other drive while installing the barest minimum of software.

Environment:

Vista Ultimate (Fully Patched)
User Account with Admin rights

Notes:

1. Download Microsoft Virtual Server 2005 R2 SP1 - Enterprise Edition (Free, Reg-ware)

Don't let the title throw you, this is the full Virtual Server 2005 R2 install AND its SP1...

Once downloaded, run it. You'll need admin rights (Install as Administrator, etc) of course (as you will through out most of this...)

2. Install just VHDMount

Do a Custom setup and set everything to Do Not Install EXCEPT for VHDMount
(assuming of course that's all you want, just the VHDMount utility. If you want everything listed, this install it all. All I wanted was just VHDMount...)

VHDMount 
[Screenshot leached from Offline VHD file mounting on the host operating system with Virtual Server 2005 R2 SP1 Beta 2]

Once the install is done, assuming you installed JUST VHDMount like I did, VHDMount may/will not yet work (with an error like "Failed to plug in the Virtual Hard Disk.").

3. Update the Drivers

From Installing Virtual Server with vhdmount only in Windows XP fails;

"What you'll need to do is go to control panel and select add new hardware.

Go through the steps until you can select "HAVE DISK" point to your VHDmount directory and select the inf file.

Make sure you select the "Microsoft Virtual Server Storage Bus".

Mount your drive using the /p command.

Go to your device manager, there you'll see a "Microsoft Virtual Server Storage Device" with an exclamation mark over its icon.

Right click on it and select "update driver", select the advanced option and point to your vhdmount directory again.

..."

Go to the Control Panel, switch to Classic View and then click on Add Hardware.
image  image  image image image image

...

Once that's all done open a CMD as Admin and;
"c:\Program Files\Microsoft Virtual Server\Vhdmount\vhdmount.exe" /p "path to your VHD here"

You should get an error or it just won't work... The next step is to update the "Microsoft Virtual Server Storage Device" Driver.

Now Start - Right click on My Computer, select Manage.

In the Device Manager "Microsoft Virtual Server Storage Device" should have an exclamation mark over its icon.

vhdmount07
[Screenshot leached from Offline VHD file mounting on the host operating system with Virtual Server 2005 R2 SP1 Beta 2]

Right click on it, select "Update Driver"

image image

Click on Next and let the driver install...

 

Now that that is all done, VHDMount, via the command line, should work for you. All you need now is some icing..

4. Add Mount/Unmount VHD Registry hack

Double clicking on a VHD to mount it

"... While vhdmount is provided as a command line tool - a very small amount of work will allow you to mount VHDs by just double clicking on them.  By creating a .reg file with the following contents:

..."

 

That's it. You should now have a Vista environment where you can double-click mount a VHD and browse it like any other drive...

 

Invaluable Resources:

B# .NET Blog Offline VHD file mounting on the host operating system with Virtual Server 2005 R2 SP1 Beta 2
Virtual PC Guy's WebLog Double clicking on a VHD to mount it
eggheadcafe.com Installing Virtual Server with vhdmount only in Windows XP fails
Microsoft Downloads Microsoft Virtual Server 2005 R2 SP1 - Enterprise Edition

10 comments:

Manuel said...

Besides that, in Vista you have to make sure that you add a /c or /d to the dismount command, and also set vhdmount.exe to use administrator privileges always (on the compatibility tab), if you have UAC on.

Greg said...

Good points... Thank you

Bink said...

Thank you! Very helpful--and I wonder why MS doesn't make this easier.

Jobskillz said...

Thank you, Thank you, Thank you.


I really like your style. Capturing a brief version of the instructions (for the slightly more advanced) then elaborating for clarity. SWEET!

Greg said...

Thanks! :)

Anonymous said...

Thank You very much :D

Yesterday I made a backup of my laptop til a USB-hd. Rebooted and installed Ubuntu. Worked nice. Installesd VirtualBox, took a little moore effort but it went just fine. Installed WinXP in VirtualBox så I could run a specific program tthat I has to use at the the University. All that went quit ok.

And now to copy over some work-files, mathematica labs, java-program and so on. Hooked up to school-server to take down the files. No! The latest files wheren't there :| They are only on the backup.

Have been stuck with trying to extract them from the backup for the last 36 hours. Just slept 4½ hour this morning.

Thanks to your information I can now extract the files I want from the backup to my virtual Windows, catch my breath and sleep a few hours more tonight :D

Since I have my .vhd-file on an external usb-hdd and runing a virtual WinXP in VirtualBox on Linux A had to copy the .vhd.file to the virtual filesystem. Thats because I have to run vhdmount as admininstator and the admin can't see the usb-hdd. It soud like a mess ut it works. Hope it can help someone else with my special kind of problem.

Thanks a lot for sharing your information :D

Anonymous said...

Just wanted to say thanks for posting this article. Excellent run down of what is required. I found several others on the net, but this worked perfectly!
Thanks again.
Darin

tiagobernardo said...

Very helpful! Thank you!

Active Directory Management ADS2WEB said...

I tried this on a XP SP3 (32 bit) system and it worked seamless.

Just downloaded, and custom installed VHDMount.

Created reg file.

All worked great. Thanks

Anonymous said...

Thank you for this post. It still does the trick, even with Vista. The only extra thing to do there is to mark "Run as administrator" on the compatibility tab on vhdmount.exe.

Best Regards,
Richard