I loathe repaving my laptop. I'm such a tool whore and run so much stuff that it's easily a week before I get back to any sort of respectable productivity. But recently I decided to repave my laptop because, well, I don't know, it seemed to "need" it. I believe that developers are more in-tune with their computers than anyone else in the human population, and although we can't explain it, we just seem to know when a computer needs repaved. So I bit the bullet, made sure everything was backed up, and started over.
In doing so, as with every other time I repave a machine, I took a step back and thought about how to better organize my files and tools. However, in this case I spent some time thinking about how to more effectively isolate all the tools and files I have that are needed for clients. As I'm sure many of you have experienced, some clients require you to run software that you would not normally install on your own machine. For me that includes things like
Lotus Notes,
StarTeam,
SameTime,
Oracle, and
F-Secure.
I've used
Virtual PC many times before and had decided I was going to go that route again, i.e. I would create a VPC image for each client, which would allow me to isolate all client software and files away from my host laptop. I still install all my usual tools and software on my host laptop, but with a VPC image per client I no longer have to install their required software on my host machine, thus keeping my host nice and clean.
The cool thing about VPC is the notion of differencing disks. Differencing disks allow you to create a parent image and then you can create a child image that uses the parent image as a base (think an inheritance model for VPC images). This means that you can create a base Windows XP SP2 image with all the hotfixins and then create a child image that uses that base OS image as the parent. So when you start the child image, the OS is already there and ready, and all you've got to do it install the tools and software you need for that particular image.
This was the route I took until I found
Jeff Julian's post about how he used differencing disks to setup client VPC images. I never thought about linking many parents/children together like he does, but that possibility opened up a whole new way of using VPC. Basically you create a VPC image for any *major* software install, such as Windows, Office, Visual Studio, and SQL Server. Once you've done that, you can create a client VPC image from the lowest base image in the group, and then merge the image tree together to create your final stand-alone VPC image for the client.
So let me do what Jeff did and show a picture what I'm talking about:
Here I have a tree structure for my VPC images with the following paths:
- WinXP SP2 > Office 2007 > SQL Server 2005 > VS2005 Pro
- WinXP SP2 > Office 2007 > SQL Server 2005 > VS2005 Team Suite
The WinXP SP2 folder contains the root OS image that acts as the base image for every child in that tree. The Office 2007 folder contains an image with Office 2007 installed and uses the WinXP SP2 image as its parent. The SQL Server 2005 folder contains an image with SQL Server 2005 installed and uses the Office 2007 image as its parent. Each VS2005 folder contains the appropriate version of Visual Studio and both use the SQL Server 2005 image as its parent.
So, if I have a client that can use WinXP SP2, Office 2007, SQL Server 2005, and VS2005 Team Suite, I would create a new VPC image that uses the VS2005 Team Suite image as its parent. Once I do that, I can edit the virtual hard disk for the client image and choose to merge the parent and child disk into a new virtual hard disk, thus creating a standalone image that I use for that client. From there I can install any software and files specific to that client only in that VPC image.
But, what if a client uses all that same software but they use VS2005 Pro instead of the Team Suite edition? Well, I do the same exact thing as I just described except I would choose the VS2005 Pro image as the parent for the client image, and then I would perform the merge operation and I'm good to go. You can see how this tree of parents/children base images could be setup for any number of different combinations you might have.
And there you have it. I've been working this way for a week now and I'm convinced it's the only way to fly. It reminds me of the
Single Responsibility Principle; just think of VPC images instead of classes. And don't forget that Virtual PC 2007 was just released and it's free to anyone, not just MSDN Subscribers.
Print | posted on Sunday, February 25, 2007 8:05 AM