Attach a VHD File in Windows XP

Recently, we posted a three-part series on using a VHD in Windows 7 to create a secure, portable file for storing your data (Create a Portable, Secure File Store in Windows 7 – Part I, Create a Portable, Secure File Store in Windows 7 – Part II, and Create a Portable, Secure File Store in Windows 7 – Part III).

If you also use Windows XP on another computer, you can transfer that VHD file to the XP computer and mount it without having to run Virtual PC or Microsoft Virtual Server. You can install only a component of Microsoft Virtual Server and run a command from the command line.

NOTE: If you have applied a password to your VHD file using BitLocker in Windows 7, as discussed in the third part of the series mentioned above, you CANNOT access your VHD file in Windows XP. You will be asked to format the drive.

Download Microsoft Virtual Server from

Start installing Microsoft Virtual Server by double-clicking on the setup.exe file. The initial Microsoft Virtual Server 2005 R2 SP1 Setup screen displays. Click the button next to Install Microsoft Virtual Server 2005 R2 SP1.

MS Virtual Server initial setup screen

The License Agreement displays. Select the I accept the terms in the license agreement radio button and click Next.

MS Virtual Server license agreement

The Customer Information screen displays. Enter your User Name and Organization. The Product Key is automatically entered. Click Next.

Entering User Name and Organization

On the Setup Type screen, select the Custom radio button and click Next.

Choosing the Setup Type

On the Custom Setup screen, click on the button next to the first feature in the list, Virtual Server Service, and select This feature will not be available from the pop-up menu.

Specifying a feature to not be available

Do the same thing for all the features except the VHD Mount feature. The Custom Setup screen should look like the following image. Click Next.


The VHD Mount feature is ready to be installed. Click Install.

Setup is ready to install

The progress of the installation process displays.

Installation progress

When the Setup Complete screen displays, click Finish.

Setup is complete

In Windows Explorer, navigate to the C:\Program Files\Microsoft Virtual Server directory. In the right pane, hold down the Shift key while right-clicking on the Vhdmount directory. Select Open Command Line Here from the pop-up menu.

Open command line here

At the command prompt, enter the following line.

vhdmount /p /f <path to VHD file>

Replace “<path to VHD file>” with the location of the VHD file you want to attach. Press Enter. You should see a message indicating the Virtual Hard Disk was successfully plugged in.

NOTE: For information about the parameters for the vhdmount command, type vhdmount at the prompt and press Enter. A list of available parameters with descriptions displays.


In Windows Explorer, your VHD file displays as a hard drive with a drive letter.

VHD file displaying as a hard drive in Windows Explorer

To detach your VHD file, enter the following line at the command prompt:

vhdmount /u <path to VHD file>

Again, replace “<path to VHD file>” with the location of your VHD file.

If you still have Windows Explorer open and your VHD selected, you will receive an error when you try to detach the VHD file. You must either select a different drive, or close Windows Explorer.

Failed to unplug the Virtual Hard Disk

Once the VHD file is no longer being used, you can enter the detach command again and you should see a message indicating that the virtual hard disk has been successfully unplugged.

VHD file successfully unplugged

This component of Microsoft Virtual Server is useful if you transfer files between a Windows 7 computer and a Windows XP computer. You can keep all your files in one portable file and easily access them on both operating systems.

by Lori Kaufman

Comments [4]

  1. Thanks for the tip. I looked at it and it looks like a useful tool. Microsoft Virtual Server does not work in Windows 2000 and Gizmo does.

  2. Needs the installer cracked in order to run it on XP home. See

Leave a Reply

Your email address will not be published. Required fields are marked *