Shrink VirtualPC 7 disk images

Jun 06, '06 07:30:03AM

Contributed by: mshmgi

I use Microsoft Virtual PC 7 to run multiple versions of Windows and Linux on my G5 (for testing web applications). VPC allows the virtual hard drives grow up to 15 GB -- which can consume quite a bit of disk space when you've got a bunch of them. In addition to consuming more disk space, larger VPC drive documents actually run slower (as if it wasn't slow enough already).

VPC allows you to "reclaim unused disk space" using the Virtual Disk Assistant. However, unless the unused disk space has been zeroed, it cannot be reclaimed. In the past, I had been using a variety of Windows disk utilities to zero the unused disk space. Users of VPC know that everything takes a long time in VPC, including zeroing the free space. Today, I discovered a much quicker solution.

WARNING: Before you try this, do yourself a huge favor and back up the VPC files that you are going to work with. Don't assume that it will always work as well as it did for me.

Here's what I did:

  1. Launch the PC and defragment the drive.
  2. Shut down the PC.
  3. Control-click on a .vpc7 document and choose the Show Package Contents option.
  4. Double-click on the BaseDrive.vhdp file (this will mount the disk).
  5. Open Apple's Disk Utility program.
  6. Select "No Name" -- under BaseDrive.vhdp.
  7. Click the Erase tab.
  8. Click Erase Free Space.
  9. Select Zero Out Deleted Files and click Erase Free Space.
  10. Use VPC's Reclaim Unused Disk Space tool.
I suppose it would also be possible to defrag using an OS X utility (after the .vhdp image is mounted), but I didn't feel that adventurous. If anybody tries it, please let me know if it works.

The Results: Total space saved: 2.67GB, or about 35% of the orginal size.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060605064908533