Rohtash Kapoor posted on November 20, 2009 15:28

Compacting a VPC Image
If you work with Virtual PC Images you must have noticed that over a period of time the size of the image file (.VHD) increases to two-to-three times of the original size. This happens because the physical image file size is increased when more data is added but not reduced when data is deleted.
Here are some simple steps to shrink the file:
- Start VPC Image.
- Delete temporary files. You can run Windows Disk Cleanup Utility.
- Shrink SQL Server Log files, if needed.
- Delete/Remove all the files, databases, software etc. which you don’t need.
- Start VPC, go to CD Menu, choose “Capture ISO Image..” option, and select the following file: “C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions\Virtual Disk Precompactor.iso”
- Goto “My Computer” in VPC and double click “PRECOMPACT(D:)”. Click “Yes” when prompted: “Would you like to prepare the virtual hard disks(s) for compaction?”
- Shutdown VPC Image.
- Run “Virtual Disk Wizard” from VPC Console. When prompted, choose “Edit an Existing Virtual Disk”, and hit “Compact” in the end.
- Enjoy the extra free space.