Shrink VPC virtual hard disks

If you’ve been working with Microsoft Virtual PC you probably noted that the virtual hard disks (.vhd files) tend to bulk out on your host drive. So here is a little tip to help with this, that I just discovered.

  1. From within your guest OS, Capture ISO… and point to C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions\Virtual Disk Precompactor.iso
  2. When AutoPlay starts up the iso, you’ll get a dialog asking you if you want to prepare the virtual hard disk for compaction. Which you of course want to
  3. When that is done, follow the instructions and shut down the guest OS
  4. From you host OS, in the Virtual PC Console. Select File -> Virtual Disk Wizard
  5. Select Edit an existing virtual disk
  6. Browse to your .vhd file
  7. Select Compact it
  8. And then choose if you want to replace the existing one or save the compacted disk as a new file
  9. Let it run, and hopefully you just freed some disk space on you host system