XP Mode and differencing disks, Creating Multiple Virtual Machines

Scenario

Scratching Head You have multiple needs for Virtual Machines based on XP mode in Windows 7. You want to use the base XP Mode operating system as a reference and create other systems using differencing disks and new virtual machine setup files (.vmcx).

Process

Differencing disks which reference the Windows XP Mode virtual hard disk and new virtual machine files will be used to create new environments which leverage the base configuration stored in the Windows XP Mode VHD file.

Reason

I want to be able to do a number of things with my XP mode virtual machines and most of all I want to be able to have multiple machines without taking up lots of Hard Drive space. Secondly, I want to be able to create virgin environments for testing.

Differencing disks allow you to reference a source disk and in this case I am using the XP mode disk found here

C:\Users\<USER>\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\Windows XP Mode.vhd

(Where <USER> is your logged on user name. Use whoami if you are not sure).

Note:

  1. The Windows XP Mode.vhd file is a differencing disk which references the parent disk: C:\Program Files\Windows XP Mode\Windows XP Mode base.vhd
  2. Be sure to mark your XP Mode.vhd as read only. This step is required or else writes to the XP Mode VHD will corrupt the other differencing disks rendering them unusable. Read-only will cause your XP mode virtual machine to fail to start. Later after you have created a new differencing VHD file to reference the XP Mode.vhd you can set the XP Mode virtual machine hard drive 1 to the new differencing disk. You will be able to use XP Mode VPC again after that.

What is in my XP Mode base

The only thing I add to my XP mode base is Security Essentials. However another good option might be the Internet Explorer upgrades. It is a matter of personal preference bear in mind there is no problem creating another level of differencing disks.

Overview of three levels of differencing disks.

image

The image above describes how the differencing disk references the XP Mode VHD. The XP Mode VHD is a differencing disk itself and it references its parent disk the XP Mode Base VHD.

Step by Step Process to creating a new Virtual Machine which uses a differencing disk that references the XP Mode VHD.

Shutdown the XP Mode Virtual Machine.

  1. By default the XP Mode Virtual Machine hibernates. It needs to be in a shutdown state to be referenced as a differencing disk parent disk. From within the XP Mode environment:
    1. Go to Start > Windows Security
    2. Select Shutdown to shutdown the Virtual Machine
  2. From the host operating system navigate to the VHD file for XP Mode and set it as read only. (C:\Users\<USER>\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\Windows XP Mode.vhd )
    1. Using windows explorer navigate to C:\Users\<USER>\AppData\Local\Microsoft\Windows Virtual PC\
    2. Right click on the Windows XP Mode.vhd file and select properties
    3. Click to enable Read-Only

Create a new virtual machine with a differencing disk.

  1. Go through the steps of creating a new virtual machine. When you get to the virtual hard disk section follow these screen shots.
    • Select Create a virtual hard disk using advanced options

image

    • Select Differencing Disk

image

    • Browse to the location of your XP Mode VHD file C:\Users\<USER>\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\Windows XP Mode.vhd

image

After you click create the virtual machine will complete.

To create other instances of the same base configuration you only need to choose the differencing disk portion while creating new virtual machines.

Conclusion

This article covers how to use differencing disks based on Windows XP mode to create multiple systems which have their own unique settings. As a consultant I find this useful for simulating other user experiences, simulating different client environments and isolating changes which may only be used temporarily.

This is an resource efficient method for saving disk space while giving you the flexibility to work according to your needs.

Now I am off to install my 32 bit Office 2010 so I can run the CRM 4.0 Outlook Client.

Suggestions for Windows 7 team

A great feature would be to give you Windows 7 Mode which would allow you to install a minimal Windows 7 environment as easily as XP mode installs an XP environment.

Jeff Loucks
Available Technology
Available Technology

2 thoughts on “XP Mode and differencing disks, Creating Multiple Virtual Machines”

  1. Hi Jeff, I’ve been trying to edit the base VHD (c:\program files\Windows XP Mode\Windows XP Mode base.vhd) file. I have been able to successfully add custom functionality to it, but then when I try to replace the base image with the one created it does not work.

    Here is my procedure I’ve been using.

    1 – Copy base image to new location (ie desktop)

    2 – Load it into the virtual machine

    3 – Make changes to the VHD

    4 – sysprep the VHD

    5 – Copy it back to c:\program files\Windows XP Mode\Windows XP Mode base.vhd

    Then when I try to use the base image from the “Windows XP Mode” shortcut, the procedure halts with an error right at the end of loading.

    Do you have any ideas?

    Dave

  2. Dave,

    You will notice in my post that I do not touch the XP Mode Base VHD. You will need to restore the XP Mode Base VHD.

    Secondly you can make as many changes to the XP Mode VHD prior to locking it down using the techniques described in my post. I then suggest for each Virtual Machine you want to create after that that you create a new VHD which is a differencing disk and which will reference the XP Mode VHD (not the XP Mode Base VHD).

    Be sure to mark your XP Mode.VHD as read only. This step is required or else writes to the XP Mode VHD will corrupt the other differencing disks rendering them unusable. Read-only will cause your XP mode virtual machine to fail to start. Later after you have created a new differencing VHD file to reference the XP Mode.VHD you can set the XP Mode virtual machine hard drive 1 to the new differencing disk. You will be able to use XP Mode VPC again after that.

    Regarding Sysprep. This technique indicates that you might be considering use on other PCs. This is not within the scope of my post. I have not investigated what happens during the XP Mode Setup which might tie the XP Mode Base to the Host Windows 7 PC. Although I suspect Microsoft may have tied the XP Mode Base VHD to the host I am not sure. In any event I am quite sure moving the XP Mode Base to another system would require proper licensing.

    Please feel free to continue this conversation by phone: 905-646-1927 x. 100

Leave a Reply

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


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>