- dotTech - http://dottech.org -

How to: Easily mount VHDs by right clicking in Windows 7 (and Windows Server 2008)

Posted By Samuel On October 14, 2011 @ 6:20 PM In Tips 'n Tricks | 6 Comments

VHDs are Virtual Hard Disks that are most commonly used as  hard drives for virtual machines. However, VHDs can also be mounted so they act like real hard drives; when mounted they appears to Windows as a real physical hard drive, and you can put files on, edit files on it, remove files on it, etc. Windows 7, and Windows Server 2008, have a new feature which allows users to mount VHDs without needing to use third party software.

While Windows 7 adds the ability to create and mount them natively (and theoretically ISO files as well), to do any of those actions you must use either DISKPART in command line or the Disk Management Console (DMC); and to use either you have to have Administrator rights.  Unfortunately, the only way to fix the Administrator rights problem is to turn off the UAC, a very bad idea.  However, there are ways to mount VHDs without using DISKPART or DMC. In this post, I am going to discuss two ways to do just that.

The first way is by using program called VHD Attach. All users have to do is install the program, and VHD Attach will add the the ability to “Attach” (mount) or “Detach” (demount) directly into the context menu (the menu that you get when you right click a file) for VHD files:

[1]

The cool thing about VHD Attach is once you run the installer, you need not (ever) run the program again. The context menu entries are done by editing the Windows registry and other geeky stuff so VHD Attach does not have to be running in order to use “Attach” and “Detach” from the context menu.

However, if you do want the run the program part of VHD Attach, you can use it to gain information about VHD files:

2009-11-13_190503 [2]

One *additional* feature VHD Attach adds is a “Detach” option on the context menu of real physical hard drives/partitions.

The second way is for the users who want more control over the whole process, or more options from the context menu, or just prefer not to download a program. Ben Armstrong, a Virtualization Program Manager at Microsoft, published on his blog “Virtual PC Guy’s Blog” a script that can do similar things as VHD Attach.  What makes his different and a bit more complex is that it uses DISKPART in the background, giving it more power.  Of course, “installing” the script is a bit more involved than running a simple EXE file. To install it run the code with the word install after it like “VHDBatch.cmd install”.  That will add the ability to mount, mount as read-only, demount, and compact the VHD.

My only complaint is that Ben Armstrong set the default double click action to mount as read-only, so if you’re like me and want it to mount it normally by default, you can download a version I modified.

You can download VHD Attach, Ben Armstrong’s script, and my modified version from the following links:

VHD Attach

Version reviewed: v1.00

Supported OS: Windows 7 and Windows 2008 Server R2

VHD Attach homepage [3] [direct download [4]]

Ben Armstrong’s Script

Version reviewed: Unknown

Supported OS: Windows 7 and Windows 2008 Server R2

Virtual PC Guy’s Blog homepage [5]

[Direct download – Ben’s Script [6]]

[Direct download – my modification of Ben’s script [7]]


Article printed from dotTech: http://dottech.org

URL to article: http://dottech.org/11841/how-to-easily-mount-vhds-by-right-clicking-in-windows-7-and-windows-server-2008/

URLs in this post:

[1] Image: http://www.jmedved.com/images/vhdattach.png

[2] Image: http://dottech.org/wp-content/uploads/2009/11/2009-11-13_190503.png

[3] VHD Attach homepage: http://www.jmedved.com/default.aspx?page=vhdattach&rendering=xhtml

[4] direct download: http://www.jmedved.com/download/vhdattach100.exe

[5] Virtual PC Guy’s Blog homepage: http://blogs.msdn.com/virtual_pc_guy/default.aspx

[6] Direct download – Ben’s Script: http://blogs.msdn.com/virtual_pc_guy/attachment/9920711.ashx

[7] Direct download – my modification of Ben’s script: http://www.shindustries.net/VHDBatchModified.zip

© 2008-2012 dotTech.org | All content is the property of its rightful owner.