Results 1 to 2 of 2

Thread: Windows - Mounting VHD files without a virtual machine

  1. #1
    Ex-MSFT Paul Adams's Avatar
    Join Date
    Jul 2003
    77 times in 59 posts
    • Paul Adams's system
      • Motherboard:
      • Asus Maximus VIII
      • CPU:
      • Intel Core i7-6700K
      • Memory:
      • 16GB
      • Storage:
      • 2x250GB SSD / 500GB SSD / 2TB HDD
      • Graphics card(s):
      • nVidia GeForce GTX1080
      • Operating System:
      • Windows 10 x64 Pro
      • Monitor(s):
      • Philips 40" 4K
      • Internet:
      • 500Mbps fiber

    Windows - Mounting VHD files without a virtual machine

    Here is a tip for those of you that might be using .VHD files a lot, that you might not already be aware of...

    VHDMount is a tool in Microsoft Virtual Server 2005 R2 SP1 which allows you to mount a virtual disk in Windows and browse/edit the contents directly.

    If you do a custom installation of the product you can deselect all but this tool, in the event that you want to use it on a client OS, for example.

    Syntax to plug in & mount a drive, specifying an optional drive letter (without a colon):
    vhdmount /m {filename.vhd} [drive letter]

    This creates an "undo disk" in your profile where any changes you make are recorded, and when you unplug the disk you have to specify whether to discard or commit those changes.
    (You can work directly with the file instead of using undo disks by using the /f argument if you prefer.)

    Syntax to unplug the drive and discard changes:
    vhdmount /u /d {filename.vhd}

    Syntax to unplug the drive and commit changes:
    vhdmount /u /c {filename.vhd}


    To add context menu ("right-click menu") options for mounting and dismounting virtual disks through Explorer, you can add some custom registry entries.
    The code section below can be copy/pasted into a .reg file and imported by double-clicking it.

    Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs.
    For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base: 256986 Description of the Microsoft Windows Registry

    Windows Registry Editor Version 5.00 
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Commit]
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Commit\command]
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /c \"%1\""
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Discard]
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Virtual.Machine.HD\shell\Dismount - Discard\command]
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /u /d \"%1\""
    @="\"C:\\Program Files\\Microsoft Virtual Server\\Vhdmount\\vhdmount.exe\" /m \"%1\""
    If you use this tweak on Vista, you need to let the OS know that vhdmount.exe is an administrative tool and should run elevated, otherwise it will fail silently as it will default to using the "user" part of your security token:
    - Browse to the folder C:\Program Files\Microsoft Virtual Server\Vhdmount
    - Right-click on vhdmount.exe, click Properties
    - Select the Compatibility tab
    - Tick the box "Run this program as an administrator" and click OK

    Now you can browse to a .vhd file produced by Virtual PC, Virtual Server or Vista's Complete PC Backup and right-click it to work with them outside a virtual environment.

    (Note I have assumed the path in which Virtual Server is installed is "C:\Program Files\Microsoft Virtual Server" - if you install to another location then you will need to change the .reg file before importing it.)
    ~ I have CDO. It's like OCD except the letters are in alphabetical order, as they should be. ~
    PC: Win10 x64 | Asus Maximus VIII | Core i7-6700K | 16GB DDR3 | 2x250GB SSD | 500GB SSD | 2TB SATA-300 | GeForce GTX1080
    Camera: Canon 60D | Sigma 10-20/4.0-5.6 | Canon 100/2.8 | Tamron 18-270/3.5-6.3

  2. #2
    Administrator Moby-Dick's Avatar
    Join Date
    Jul 2003
    There's no place like ::1 (IPv6 version)
    385 times in 314 posts

    Re: Windows - Mounting VHD files without a virtual machine

    nice !!
    my Virtualisation Blog Virtualisation Podcast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Windows Vista retail doomed unless Microsoft cuts prices?
    By Bob Crabtree in forum HEXUS News
    Replies: 132
    Last Post: 02-04-2007, 01:05 PM
  2. Virtual Windows (Funny!)
    By Jonny in forum General Discussion
    Replies: 15
    Last Post: 20-03-2006, 11:20 PM
  3. Windows Media Center 2005 machine - advice/comments required!
    By Tobeman in forum PC Hardware and Components
    Replies: 11
    Last Post: 23-01-2006, 09:55 PM
  4. VMware Virtual Machine Networking?
    By sybrows in forum Networking and Broadband
    Replies: 3
    Last Post: 01-06-2005, 12:28 AM
  5. Playing Dos Games on a Windows XP machine.
    By hotpurple in forum Help! Quick Relief From Tech Headaches
    Replies: 10
    Last Post: 15-07-2004, 08:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts