Before start the process please make sure,
- The file is a sparse disk image, and not pre-allocated.
- The VM does not have snapshots.
Erase free space on the guest OS’s disk from within the guest OS using Disk Utility, then shrink the guest OS’s disk from the host OS using vmware-vdiskmanager at the command line.
In the guest OS:
- Open Disk Utility.
- Select the guest OS’s partition.
- Go to the “Erase” tab.
- Click on the “Erase Free Space” button.
- Make sure “Zero Out Deleted Files” is selected, and erase the free space.
- Once it’s finished, close Disk Utility, and shut down the guest OS.
diskutil secureErase freespace 0 Macintosh HD
In the host OS:
- Open Terminal as an Administrator and type:
path-of-vmware-foldervmware-diskmanager -k path-of-virtual-machineguest-name.vmdk
Press Enter
Note: It will take a while to shrink the Virtual Disk.