This article covers how to shrink VMDK Virtual Disk Size on VMWare ESXi.
By default, VMware creates "growable" disks that grow larger in size as you add data.
Unfortunately, they don't automatically shrink when you remove data.
You'll need to clean up or compact your disks to actually free up space on your hard drive.
VMware Workstation also allows you to create snapshots, which contain a complete "snapshot" of a virtual machine's state at the point in time you created them.
These can take a lot of space if the virtual machine has changed significantly since then.
You can free up additional space by deleting snapshots you no longer need.
1. To view the snapshots for a virtual machine, select the virtual machine in VMware Workstation and click VM > Snapshot > Snapshot Manager.
2. To delete a snapshot you no longer need, right-click it in the Snapshot Manager window and select "Delete". It will be removed from your computer.
3. You won't be able to restore your virtual machine to that previous point in time after deleting the snapshot, of course.
Before we try to shrink the virtual disk files, we should try to remove any unneeded files from the virtual machine to free space.
For example, on Debian-based VMs, you can run:
$ apt-get clean
To clear out the local repository of retrieved package files.
Next, run the command below to fill the unused space with zeros:
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
Free Disk Space In VMware Workstation
In VMware Workstation, first power off the virtual machine you want to compact. You can't complete this process if it's powered on or suspended.
1. Select the virtual machine you want to compact in the main window and click VM > Manage > Clean Up Disks.
2. The tool will analyze the selected virtual machine's disk and show you how much space you can reclaim.
To reclaim the space, click "Clean up now".
If no space can be freed, you'll see a "Cleanup is not necessary" message here instead.