Working with Virtual Windows XP Disks in Windows 7

Posted on September 28, 2009 by Daniel Petri in Virtualization with 0 Comments

This article is one of a list of articles dealing with Windows Virtual PC on Windows 7, and in it I will show you how the default virtual Windows XP  machine used for enabling the Windows XP Mode (or XPM for short) uses virtual hard disks. Knowing how it works with VHD files will save you a lot of time trying to figure out where and what uses all that disk space.

Note: This article is directly related to the default Windows XP virtual machine used by Windows XP Mode (or XPM). When you create additional virtual hard disks, and when you use your own virtual machines, you can configure them to store the VHD files anywhere you want.

First, if you haven’t done so yet, install Virtual PC and then install the default Virtual Windows XP machine. You can use my “Installing Virtual PC on Windows 7” and “Installing Windows XP Mode (XPM) on Windows 7” articles for more information on that.

Now lets take a look at the way it uses virtual disks.

Note: All screenshots and procedures are based on the RC version of Windows 7, and the beta version of Virtual PC.

By default, the Virtual Windows XP machine uses one (1) virtual disk that is configured as a dynamically expanding differencing disk. This is the parent disk:

C:\Program Files\Virtual Windows XP\Virtual Windows XP.vhd

Note: In the RC version, this path was changed to C:\Program Files\Windows XP Mode\Windows XP Mode base.vhd.

Now, unlike a regular differencing disk, a dynamically expanding differencing disk uses 2 VHD files. One is the parent disk (the Virtual Windows XP.vhd file), and another VHD file that stores all the changes, in a bit level, made since the parent disk has been created. In my case, this is the location of the differencing disk:

D:\XPM\Virtual Windows XP.vhd

Note: In the RC version, this file name was changed to Windows XP Mode.vhd.

This is the parent disk:

working-with-vpc-vhd-files-xpm-1

As you can see, the file is 1.04 GB in size, and the installation automatically configures it as a read only file.

working-with-vpc-vhd-files-xpm-2

And this is the differencing disk, which can be smaller, but usually is bigger than what you see here:

working-with-vpc-vhd-files-xpm-3

What makes the differencing disk bigger is the amount of changes, compared to the parent virtual hard disk. Whenever there’s a bit that’s different, it will be written in the differencing disk. So the more you work with it, the more programs you install, whenever you update the virtual machine from Windows Update, whenever you install IE 7 or IE 8 (the default Virtual Windows XP machine comes with IE 6), then you will make the differencing disk bigger and bigger. The interesting stuff is that even if you delete a lot of information from it, it’ll still grow, as from a bit to bit perspective, it has changed when compared to the parent disk.

Note that you can compact this disk, and you can even merge it into the parent disk or into a new VHD file. More on that in a future article.

Sponsored