Mounting VHD files in Vista

Posted on July 9th, 2009 in Server 2003, Server 2008, Storage, Virtualisation, Vista, Windows 7 by alt-92

Windows 7 features include attaching and detaching Virtual Harddrive files (.VHD) via Disk Management.
This allows you to mount and dismount your Complete PC Backup .vhd file to restore a single item from backup or prestage a Virtual PC/Server diskfile, or even your HyperV disks.

Vista does not have this feature, but there is a workaround available. Installing the VHDMount utility from Virtual Server 2005R2 SP1 lets you use the VHD storage driver and the vhdmount utility.

  1. Download the Virtual Server 2005 R2 SP1 setup from http://www.microsoft.com/windowsserversystem/virtualserver/downloads.aspx .
  2. Run setup and choose Custom Setup type:

    vhdmount1
    vhdmount2

  3. Verify the default selection for VHD Mount is marked:

    vhdmount3

    Click Next to install and finish the setup.

    vhdmount4

  4. You can use the command line vhdmount utility to attach a .VHD file, or alternatively, use these registry entries to create a context menu for the four actions.

    01
    Windows Registry Editor Version 5.00
    02
     
    03
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD]
    04
    @="Virtual Machine Hard Drive Image"
    05
     
    06
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\DefaultIcon]
    07
    @="C:\\Program Files\\Microsoft Virtual PC\\Virtual PC.exe,-327"
    08
     
    09
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell]
    10
    @="Mount"
    11
     
    12
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Commit]
    13
     
    14
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Commit\command]
    15
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /c \"%1\""
    16
     
    17
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Discard]
    18
     
    19
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Discard\command]
    20
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /d \"%1\""
    21
     
    22
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount]
    23
     
    24
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount\command]
    25
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /d \"%1\""
    26
     
    27
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Mount]
    28
     
    29
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Mount\command]
    30
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /p \"%1\""
    The result is a context menu on right-clicking a .VHD file like this.

    vhdmount5

    Mounting your disk file is now as easy as a right-click away, and the VHD will show up as a new disk in Explorer.

Comments are closed.