Hold the phone. A reader just tried the procedure described in the UPDATE section below and found out that when you finally go to convert from the fixed back to a dynamically expanding disk, you never get prompted for a new disk size. If this is true, this handy workaround is pretty much worthless. Has anyone else attempted this that could confirm? Yes, I'm too lazy to do it myself.
The information in the original post is pretty much obsolete, or perhaps more accurately put, incompetent. Thanks to a recent anonymous comment, all I had to do was convert the VHD to a fixed disk and then back to dynamically expanding. Read on if you'd like to learn how to do it the hard way.
So, you may or may not know that I'm a huge fan and user of Virtual PC and Virtual Server. For over two years, I've been using virtualization exclusively for software development. Sure, there's a slight performance hit, but you can't beet the flexibility you gain from having one (or more) isolated development environments. Before using Virtual PC, it was common for me to be wiping my laptop once every 4 to 6 months. Now, since I don't run any development tool software on my host OS, it's rare that I have to rebuild my host machine. And, of course, creating new virtual PC's is a snap.
Virtual PC, Virtual Server, and VMWare all use the concept of virtual hard drives (or VHD's). These are nothing more than files on your physical host OS's drive that represent a virtual drive. They can be fixed in size (like a physical drive) or dynamically expand. The later option is handy in that such a VHD only takes up as much physical space as it needs, gradually growing over time. The benefit is it saves a lot on physical drive space, especially if you manage multiple virtual machines.
When you create a virtually expanding VHD you have to specify its maximum size; for Virtual PC the default max size is 16MB. The kicker is when you're using that VHD and all of the sudden one day you run out of room. It's the same experience you have when you run out of room with a physical drive - you immediately try to free up space by deleting unnecessary files and uninstalling unused apps.
However, I recently ran into a scenario where making more room wasn't enough. I was installing Visual Studio 2005 Service Pack 1, which requires a ton of free disk space (over 2GB I think) and I couldn't make it happen. Since you can't change the max size of an existing VHD, I only had two options:
- Rebuild my virtual machine with a larger VHD.
- Somehow transfer the contents of my existing VHD to a new empty VHD.
Doing a little digging, I found there are several utilities out there. Norton Ghost is one. The one I chose was Acronis True Image Server (I installed the Server version since my OS was Windows Server 2003). Neither of these are free, so you have to either buy them or use their trial edition. The process I used was the following:
- Create a new empty dynamically expanding VHD (with a more desirable max size) and mount it to the virtual machine.
- Install Acronis True Image Server on the virtual machine.
- Start True Image and run the Clone Disk wizard.
- Unmount the old VHD.
- Mount the new VHD as drive 0.
AN IMPORTANT NOTE:
Before you perform this operation, make sure you have plenty of room on the physical drive that contains the new VHD. Running out of physical drive space as the new VHD is getting filled (and expanded) can cause the clone to fail. Learned that one the hard way :).