Windows XP/Vista: How to Attach a VHD File

Contributor Icon Contributed by shamanstears Date Icon November 12, 2008  
Tag Icon Tagged: Microsoft Vista

If you wish to access the contents of a VHD file without having to run Virtual PC or Virtual Server, you can do so on Windows XP and Vista by installing only a component of Virtual Server and running a single command from the command line.

Download Virtual Server 2005 R2 and install as follows:

1. Continue through the installation process until you come to the Setup Type.

2. Select Custom from the two available setup types.

3. Click Next.

4. From Custom Setup, deselect all features to be installed EXCEPT VHD Mount.

5. Click Next.

6. Click Install.



To attach a vhd file:

1. Open Windows Explorer and browse to C:\Program Files\Microsoft Virtual Server.

2. Hold down the Shift key and right-click on the Vhdmount directory.

3. Select Open Command Window Here from the context menu.

4. At the resulting command prompt, input the following:

vhdmount /p /f [path to vhd file]

For example: vhdmount /p /f E:\VirtualXP\VirtualXP.vhd

Windows will install the driver and the vhd file will be added as a drive that you can access from Computer.



To detach a vhd file:

1. Open Windows Explorer and browse to C:\Program Files\Microsoft Virtual Server.

2. Hold down the Shift key and right-click on the Vhdmount directory.

3. Select Open Command Window Here from the context menu.

4. At the resulting command prompt, input the following:

vhdmount /u [path to vhd file]

For example: vhdmount /u E:\VirtualXP\VirtualXP.vhd

The virtual disk will be unplugged and will no longer be listed as a drive.

Previous recipe | Next recipe |
 
  • ashwin
    thanks a lot for sharing the information... i will try...
  • Ahmed Ehteham Zaedi
    What happens after that, meaning after attaching vhd drive how am i going to boot from the vhd drive.
  • CognitivePainkiller
    Or without installation you may use:
    MMC
    and then using the Disk Management plugin.
    There you can attach every VHD you want.

    Gr33tz, CognitivePainkiller.
  • bpak
    Is there any How To on doing this MMC as Cognitive Painkiller says???
  • Crofter
    Unfortunately this only apples to Win XP Pro and Vista -- Not XP Home which is what I need it for. Damn, Damn, Damn!
  • uno
    Does vhdmount work for Vista Home Premium or requires Ultimate/Business?
  • marklarson
    Vista Home Premium should have diskpart built in. Try "attach vdisk file=[PATH to VHD]" and it should attach it without a hitch and assign it a drive letter.
blog comments powered by Disqus