Skip to content

Instantly share code, notes, and snippets.

@davidino
Last active December 21, 2016 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidino/50010dd15190c6701697 to your computer and use it in GitHub Desktop.
Save davidino/50010dd15190c6701697 to your computer and use it in GitHub Desktop.
shrink the vm

Problem

The vm is continuously growing. Even when you free space ( from inside ) then the virtual disk will not change the size:

Solution

Inside the VM run that command:

cd ~
sudo cat /dev/zero > zero;sync;sleep 1;sudo rm zero

this it can take a while, since it can create a big file (more than 10min).

Turn off the vm.

Run this command from osx:

cd '/Applications/VMware Fusion.app/Contents/Library'
./vmware-vdiskmanager -d <path_to_your>/disc.vmdk
./vmware-vdiskmanager -k <path_to_your>/disc.vmdk
  • -d will run a defragmentation
  • -k will shrink the vm disk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment