Using the Compact command in VMware Workstation/Player is supposed to downsize the virtual disk (.vmdk) file to the actual size of data that’s on it. Usually this doesn’t happen; the operation take a long time, and file remains the same size.
Note: The virtual disk must not be pre-allocated for this to work. When creating a virtual disk, you are given the option to allocate the disk space - don’t do it.
How to compact the disk
Turn off the virtual machine
Defragment the disk (VM Settings → Select Drive → Utility → Defragment)
Turn on the virtual machine
Wipe the free space on the disk (this is the key step)
In order to do this, you need to use a third party tool for your operating system:
- Windows: CCleaner Free or similar. (Tools → Drive Wiper → Select Drive → Wipe)
- Linux: secure-delete tool suite or similar.
Turn off the virtual machine
Compact the virtual disk (VM Settings → Select Drive → Utility → Compact)