Shrinking vmware instances

Let’s say you have several vmware instances you don’t use currently but have to keep it for future. What about shrinking  their size, so they don’t take so much size on preciouse laptop HD ?

This snippet is taken from 41 technologies

  1. First backup your guest os disk image and other files (just in case something goes wrong) + make sure you have plenty of spare disk space on your harddrive.
  2. Start Windows guest OS in VMWare Fusion and login as administrator
  3. Clean up & defrag guest OS disk image from within guest OS
    * Delete all unused files, empty your trash can, delete your browser cache etc.
    * Defragment your guest OS (f.x. using “defrag c:” in the cmd prompt).
  4. Zero out unused disk space in guest OS disk image
    * Download Mark Russinovich’s disk erase tool SDelete v1.51+ and place it on the local guest drive (*1).
    * From a command prompt navigate to where you saved the above delete tool and write “sdelete -c c:”, which will clear all free disk space
  5. Close guest OS and VMWare
    * Shutdown your Windows guest OS.
    * Quit VMWare fusion
  6. Shrink disk image using VMWare’s diskTool
    * Navigate to the VMWare Fusion tools directory. E.g. type “cd /Applications/VMware Fusion.app/Contents/MacOS”
    * Run VMWare Fusion’s diskTool command with the shrink option “-k” to compact your virtual drive (*.vmdk). E.g. type “./diskTool -k 0 full-path-to-your-virtual-desk-image.vmdk”. (*2)
  7. Finished!

If you need more, read whole article on 41 technologies it includes also suggestion if you use snapshots.

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s