Ran into an issue recently with one of my VMs. Wanted to back it up but was 200GB. I knew there wasn’t that much data on it anymore, it had just grown to that. But in Windows when you delete a file you don’t delete it really, Windows just flags it to be overwritten.

You can use this tool first but don’t think it’s needed. CCleaner and Fileshredder can do the same. That is, wipe the free space while in Windows.

SDelete Sysinternals as MS

In Windows go to a CMD and to the location of sdelete and type

sdelete -c

That cleans the free space. Then shut down the VM.

Once shut down go to a CMD and go to where VMWARE is installed. Mine is

D:\Program Files (x86)\VMware\VMware Workstation

Then run vmware-vdiskmanager.exe to shrink the VM. This is done with the -k switch.

My VM was in a different location to the diskmanager tool so ended up like this

vmware-vdiskmanager.exe -k “f:\vm\test lab\xp.vmdk”

Once you hit enter you should see a Shrink: 0% meaning it’s started. Could take a while. I just left mine running while at work so don’t know how long it took.

The ” are needed it appears.

It works great. Mine went from 200GB to 26GB.

This site helped with this discovery.