Go to content Go to navigation Go to search

VM Shrinking

Thanks to Jeff Atwood over at Coding Horror for inspiring this work.

Just finished shrinking the VMWare Fusion virtual machines I use for browser-compatibility testing. They both run Windows XP (with service pack 3). Here are the results:

The VM running Internet Explorer 6 now uses 547 megabytes of virtual disk space and 736 megabytes of actual disk space. The VM running Internet Explorer 7 uses 572 megabytes of virtual disk space and 750 megabytes of actual disk space. (I’m not sure what VMWare Fusion is doing with that extra 150 megabytes of space in each VM.)

The most valuable tool I used to shrink things down was XPLite . I was stuck at just over 1 gigabytes of actual disk space until I purchased the professional version, and was able to shave the final 300 megabytes or so.

Using XPLite can be a little overwhelming due to the many applications it offers to remove or disable. Since my VMs only exist so I can test browser compatibility on Windows, I don’t need much, so this is what I chose to keep (everything else is unchecked):

I also used XPLite to disable Windows File Protection (this feature keeps a copy of all system/important DLLs/executables in Windows’ system32\dllcache directory).

After uninstalling all these unneeded Windows components, I used the Shrink tab in XPLite to remove all the files it suggests should be removed. A couple of times, some files were left in the Windows\Temp and Windows\SoftwareDistribution directory, and I ended up deleted the contents of those directories by hand (some of these files are in use, preventing me from deleting them, so I just delete as many as I can).

After XPLite has done its magic, I run Windows’ Disk Cleanup wizard (right-click c: drive and choose Properties, then click the “Disk Cleanup” button) and let it delete and compress all the files it wants.

I then had VMWare Fusion shrink the virtual hard drive, which makes the size of the actual disk drive more closely resemble the virtual drive.

For ongoing maintenance, I usually run the cleanup from XPLite’s Shrink tab after each Windows update. It deletes all the uninstall, temporary, and software distribution files that usually hang around.