Scott Hanselman

Transferring/Moving a VHD from Windows Virtual PC (Windows XP Mode) to another computer

March 06, 2011 Comment on this post [4] Posted in Tools
Sponsored By

One of the great things about Windows 7 is "Windows XP Mode" which is basically that you get a copy of Windows XP that runs under Windows Virtual PC. It can run "seamlessly" which means you can run XP apps within the VM under Windows 7 with complete compatibility and it looks like the apps are running under Windows 7 itself. They are in the Start Menu and you don't have a "VM Window" like you usually see.

However, in order to save disk space and allow folks to have a base image and multiple XP images, the default disk setting for XP Mode is "differencing." That means that there's a base Windows XP Mode "base" VHD file in "C:\Program Files\Windows XP Mode\Windows XP Mode base.vhd." This file is the base that your instance of Windows XP is, ahem, based on.

If you want to move your Windows XP Mode Virtual Machine to another box, as I did tonight, you might get an error like:

...one of the parent hard disks is missing...

This means that the VM you moved can't find the base disk.

So the question is, how can you make your Windows XP Mode VHD more portable?

First, shut down your VM. Don't hibernate it, actually shut it down. They really want you to hibernate. To shut down, launch the main virtual machine and click the Ctrl+Alt+Del top level menu item, then select Shut Down.

Shutting down Windows XP Mode

Next, go to the Virtual Machines folder. I do this by typing "virtual" in the search box at the Start Menu. Confirm you are really powered down.

image

Next, right click your VM and select Settings, then click the Hard Disk 1 option on the left.

Windows XP Mode - Windows Virtual PC Settings

See how it has a Virtual hard disk file then a Parent Disk? Now click Modify.

Modify virtual hard disk - Merge

From this dialog, click Merge. We are going to Merge the two disks into one disk so we can move it to another machine.

You can choose to do this in place, or make a new file somewhere, which is what I did.

Modify virtual hard disk

Note that if you change the name of your VHD file, you may need to hook it up again in your VMC file (your Virtual Machine settings) when you move your disk to the other machine. Alternatively, you can open up the .vmc file in notepad and carefully change the name of the VHD it thinks it's pointing two in two places.

Last note, you'll likely be prompted for a Name and Password to log into your Windows XP VM on your new machine. You'll need to remember your password, but chances are your username is XPMUser. That's tricky.

Hope this helps.

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
March 06, 2011 18:00
Assuming the base hard disk is the same for everyone running Windows XP Mode (which seems like a reasonable assumption), shouldn't it be possible to just copy the differencing VHD to another machine with XP Mode and then boot it? You might have to change the location where it looks for the parent hard disk or something like that, but that would be all.
March 06, 2011 21:49
Windows for Workgroups 3.11? Seriously? :-)
ben
November 08, 2011 4:53
Awesome. Exactly what I was looking for. Needed to move my XP VM from dying Win7/Core2 box to an i7 box, and had backed up all the little snippets, but sheesh, what a pain, and no guarantee it would even work moving over. This trick was the magic bullet I was looking for.

THANK YOU! :-)
November 19, 2011 23:03
Ok, I've got the merged file. When I reinstall Win 7, what do I do with the merged file for the VM to run?

Thanks!!

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.