Wednesday, September 12, 2007
How to shrink Virtual PC VHD files
Virtual PC 2007 virtual hard drive files (.VHDs) can grow to very large sizes. The virtual hard drive can be configured to automatically expand when things like service packs are installed and they don't shrink back.
In addition, if you move a VHD file from a FAT32 partition to NTFS it comes with .V01, .V02, etc files, you can join and shrink these as well using the process below.
While storage is not expensive at the moment, if like me you have more than a dozen Virtual PC drives for various reasons or back them up regularly, you can easily eat up a 250 gig drive in no time.
So how do you shrink a .VHD file?
- Install CCLEANER.EXE (http://ccleaner.com) to remove unnecessary files
- Disable hibernation (power options in Control Panel > disable hiberation)
- Defragment your local hard drive that has the VHD files on it
- Start your Virtual PC
- If you have not installed the Virtual PC Additions, do so (File > Virtual Machine Additions)
- Once started, run the “Virtual Disk Precompactor.iso”; to do this, go to the little cd disk icon at the bottom of your Virtual PC and mount the “Virtual Disk Precompactor.iso” file located at C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions
- Run the Precompactor if it doesn’t start automatically by going into Windows explorer and clicking the CD drive that was created, takes a little while
- Shutdown your Virtual PC
- Run the Virtual Disk Wizard, go to the Virtual PC console > File > Virtual Disk Wizard and choose the "Edit an existing virtual disk" bullet > then Next > Then navigate to the .VHD file > then Next > then select the compact option. This takes a while.
- When done, you should have a smaller VHD
Labels: Virtual PC