Scott Hanselman

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

March 6, '11 Comments [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. I am a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Sunday, March 06, 2011 2:00:13 PM UTC
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.
Aaron
Sunday, March 06, 2011 5:49:50 PM UTC
Windows for Workgroups 3.11? Seriously? :-)
ben
Tuesday, November 08, 2011 12:53:01 AM UTC
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! :-)
Saturday, November 19, 2011 7:03:18 PM UTC
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.