Friday, October 22, 2004

Virtual PC Differencing Virtual Disks for Dummies [ie. for Me]

As you all might know I really like MS's Virtual PC 2004. It's one of the best development enhancing utilities I've used in a long time. I use VPC on 2 year old notebook so I'm always looking for ways to improve performance as well as overall ways to better use it.

Well I've been seeing a number of postings (here, here, and here) on using and creating Differencing Virtual Hard drives recently. So I thought I'd give them a try.

Following the instructions in the Help (and posts) I used the Virtual Disk Wizard and created a Differencing disk. Cool, that was easy.

Then all excited (yeah I really need a life) I fire up the Guest OS (in this case XP2) and do stuff on it. Checking the size of the Parent .VHD it's getting bigger! And the Diff disk I just created isn't growing. GRR.

I do all the steps again. And again the same results. GRRR

I read the help again. The posts again. And try again. Same results. GRRRR

I decide it's time to stop and take a walk around my brain and think for a bit. I really read the posts and Help. Take some time to think about the underlying purpose of a Differencing disk.

I realize the problem. It's a "Head space and timing" issue, i.e. I'm a dummy.

The one thing I WASN'T doing was going back to the Virtual PC Console - Settings of the Guest OS and switching the Hard Disk 1 from the Parent VHD to the new Differencing Disk!

Once I did that, everything worked just as it was supposed to. The Differencing VHD grew, the Parent VHD stopped growing, etc.

So simple in hindsight. So logical, given the purpose behind Differencing Disks. So RTFM of me. grrr

Now I'm thinking about deleting my "uber-VHD's" that have everything installed, going back to my baseline images and move forward with Differencing disks.

Note to Self:
One thing I need to look at.... Page files. How best to handle page files when using Differencing Disks? The parent VHD will have a Page file. The Differencing Disks will have a "Diff'ed" page file too. So the Diff's VHD's size will be inflated by the page file.

What about creating a Second Virtual disk for the Guest OS and put the Page file there? That way the Diff doesn't inflate?

Interesting... Trying that now.


Update #1:
While putting the Page file on a second VHD for the page file helped, after thinking about it, it doesn't really make much sense. Yes it keeps the Diff VHD from inflating a little, but the goal of using Diff's at all is to increase the reusability of the original VHD. To allow me to have multiple Virtual PC's on a my PC, pointing to different DIFF's, point to the same Parent VHD.

Guest OS (Office 2000 installed)   -> DIFF01.VHD -> ParentXP2.VHD
Guest OS (Office XP installed)      -> DIFF02.VHD -> ParentXP2.VHD
Guest OS (Office 2003 Installed)   -> DIFF03.VHD -> ParentXP2.VHD

So each of the above Guest OS's would have to have their own PageFile.VHD anyway. The net free drive space gain would be negligible and the admin overhead too much.

Oh well, nice thought anyway.

1 comment:

Anonymous said...

So I stumpled across this post... It is pretty dated, but maybe someone else will stumple on it too.

You should make sure you mark the parent vhd as READONLY. It's considered a best practice, and you would have known immediately what the problem was in the scenario you described in this post.

Anyways, thanks for sharing :)