After slowly using the old method below for a dozen VMs, I started to wonder if there was a better way to just always write zeros when deleting files or to have the OS circle back around later to zero unused space. I thought there might be some sort of kernel or file-system option in Linux. I didn't find one, but what I did find was fstrim. It is designed to zero free space on mounted volumes and can find them by itself.
So... this new method is much easier and faster. Options vary by version of fstrim and Linux distro, but -a, --all and -v, --verbose seem well supported.
sudo fstrim --all --verbose
Old method:
To recover empty space in thin VM disks, it is often necessary to overwrite empty space inside the VM with zeroes. The zerofree utility is a good way to do that for the common ext file systems. Once the free space is zeroed, VM hypervisor software will often either recognize and reclaim the space on the host volume, or provide a utility to reclaim the space. Check your hypervisor documentation. In the case of host volumes using VMWare filesystem (VMFS) version 6 and higher, the reclaiming of zeroed space happens automatically in the background. Older versions require running a utility.
The easiest way to zero the free space on common Linux filesystems is to boot to a recent gparted live CD .iso file. Your VM software should let you mount the .iso file as a CDROM for the VM to boot. You may have to get into the VM BIOS to change the boot order.
Once GParted starts to boot, you should be able to choose all defaults and end up with a graphical interface that includes a running GParted and a desktop with a few other applications.
To write zeros to all the unclaimed space, see if you can spot the root device in the GParted GUI and then open the terminal application and run something like:
sudo zerofree -v <whatever_the_root_device_is>
For example:
sudo zerofree -v /dev/sda1
Note: If LVM is in use (you can tell from the GParted GUI that opens if you see an extended partition with an lvm2 pv filesystem), open terminal and run:
sudo lvdisplay
to find root device before running zerofree. Your zerofree command might then look something like:
sudo zerofree -v /dev/myhost-vg/root