Friday, August 12, 2011

Shrinking a pre-allocated Mac VMWare Fusion virtual machine image

My "pre-allocated" VMWare image was taking up 120 GB on my drive for about 40GB of data. I found many references on how to shrink these images (.vmdsk), but they were largely obsolete and misleading. It takes a while, and the steps are weird, but it's fully supported by VMWare 3.

At a high level, here are the steps. Alas, I'm short of time so no details.

  1. Close down the guest OS.
  2. Using VMWare settings for 'hard drive' you can change the image from pre-allocated to the default. This takes hours but it works.
  3. Open the guest OS and run XP defrag.
  4. In the guest OS update VMWare tools.
  5. In the guest OS Run VMWare tools "shrink". Takes hours.
  6. In the guest OS Defrag again as a nice-to-do.
  7. Shut down and restart to make it all nice and clean.

My image now consumes about 45 GB of drive space. It's not pre-allocated, so it will get host OS fragmented as it grows but I can live with that.

No comments: