OT: If you’re not using Virtual PC … you should be

Okay, before I go anywhere, I want to give 100% credit for this post to John Bristowe. He showed me this at
Tech-Ed. He was going to do a Grok Talk on the subject, but just got too busy I
think. He (and me too now) is genuinely shocked more developers aren't using
Virtual PC. Now I've used VPC quite a bit since its release (and even before it
was called Virtual PC). However, during our conversation, John showed me a very
cool feature I didn't even know existed ... Differencing Disks. If you
already know what Differencing Disks are in the context of Virtual PC,
you can click next in your RSS aggregator ... because the rest of this post is
about how to use them to create many different development environments with
very little effort and hard space.

Differencing Disks allow you to use an existing VHD (Virtual Hard
Disk) as the parent for a new VHD. For example, if you want to have one VPC for
Visual Studio 2003 and a different one for Visual Studio 2005 Beta 2, and you
wanted them both on Windows XP Professional, you can create a parent VHD with
Windows XP Pro on it and use it as the parent for each of the two Visual Studio
VPCs. This saves a ton of hard disk space because the OS only exists in a single
VHD. It also saves a lot of time - have you ever created copies of VHDs or
installed the same OS on several VHDs? Yuck. This is how I'm setting up my VPC

The beauty of this is each of the product are only installed once even if I
have several different systems using it. Nice, huh? Okay, let me show you have
to put this into practice ... just in case you were curious.

In the next few screen shots, I'm going to create a new VPC for a Visual
Studio 2005 Beta 2 release based on an existing Windows XP Professional VPC.
This is what my Virtual PC Console looks like:

The first step is to create a new VPC. Be sure to put it exactly where you
want it using the Browse button (I keep mine on an external USB drive).
Define the amount of memory you want it to have and create a
new VHD. Now go to the Settings of the VPC and click
on the new VHD.

From here, click on the Virtual Disk Wizard button and create
a new VHD.

For the location, choose the same VHD that was just created with the new
Virtual PC.

When you click the Next button here, you'll be asked if you want to
overwrite the existing file. You do. The next step is deciding what kind of VHD
it is. Of course you want a Differencing Disk.

The rest is self explanatory. When you start up this VPC, you'll notice that
Windows XP is already up and running for you ... no duplication ... and no
wasted time. I am totally using this snot out of this. THANKS

Comments (12)
  1. I want to add that if you plan to use the same base Windows disk for multiple VPC running in the same net at the same time you have to change the SID in the differential disk, using tools like NewSID or SysPrep

  2. Roger Heim says:

    So let me understand what you did here. You started with a clean WinXPPro base, then created a diff disk that added VS2003, then created 3 more diff disks (diff disks from a diff disk?) that added WSE 3.0 CTP to one, WSE 2.0 SP3 to the second, and nothing in particular to the third? You also started from the same WinXPPro base and created another diff disk for VS2005B2, then created 2 more diff disks from the VS2005 diff disk; one that added Indigo/WinFx and one for general use?

    If you have two diff disks from the same base can you have both diff disk VM’s running at the same time? IOW, can you run the VS2003 VM and the VS2005 VM simultaneously?

  3. LockSmithDon says:

    Yes Roger, you are exactly right – that’s what I’ve done.

    I don’t have a use case where I’ll want to network between two like Operating Systems. If I’m going to network b/w 2 VPCs, it will be between WinSvr2003 and WinXPPro – not b/w 2 WinXPPro VPCs. However, I did fire up the Whidbey and the Everett VPCs at the same time. Of course my poor laptop slowed to a crawl (it’s old), but this is what I experienced. I was able to ping one from the other, but not the other way around. I also kept loosing keyboard support, which was weird. This could be related to the SID problem, but I didn’t see anything in my event logs. I would follow Lorenzo’s advice if you think you’re going to be networking b/w like Operating Systems.

  4. Nick says:

    What I like to do is build my base image, sysprep it, and then add diff. disks to that sysprep’d VHD. That way I can have diffdisk1.vhd added to customer-A’s domain, diffdisk2.vhd added to customerB’s domain, etc. This makes it fairly quick and easy to do troubleshooting in different environments, without having to worry about reproducing the base-application set.

    The thing that has surprised me the most about the diff disk feature in Virtual PC is that it’s surprisingly hidden for such a powerful feature.

    For instance, using VMware you have a "snapshot" tool that gives you the basic disk. diff. functionality, and then builds on it for better management and documentation of all your snapshots.

    I blogged something about this earlier this week… http://addicted-to-it.blogspot.com/2005/06/virtual-pc-using-differencing-disks-to.html

  5. I wonder, how to apply OS hotfixes in this scheme?..

    Is it really possible to boot onto Common Data Drive itself, apply there hotfixes and expect that diffs still will be usable?

  6. Nick says:

    Yeah, that’s the real kicker… you can’t update the base image without breaking your diffs. I typically set my base image to be read-only, so I don’t accidently use it or change it.

    This can quickly become a big maintenance problem for IT departments… not to mention if people start sharing images without chaing the SIDs/computernames/IPaddress…

  7. Il y a peu, j’ai appris que l’on pouvait faire des images Virtual PC différentielles dont le principe…

  8. Visual Studio Team System User Education – Process Planning Guide

    David has written a nice guideline…

  9. Visual Studio Team System User Education – Process Planning Guide

    David has written a nice guideline…

  10. Stewart Whaley says:

    Does Microsoft Virtual Server support this feature?

  11. Nick says:

    Excellent tip

Comments are closed.

Skip to main content