On my Windows system, I have WSL2 with Ubuntu installed. I found the ubuntu vhdx file is about 64 GB in size. However, when I try to compact it, the size does not shrink.
df -h shows:
Filesystem Size Used Avail Use% Mounted on
/dev/sdd 251G 215G 24G 91% /
sudo du / -x -d 1 -h shows:
346M /home
4.0K /srv
7.1M /etc
4.0K /opt
20K /root
4.0K /mnt
2.4G /usr
4.0K /media
4.0K /boot
4.0K /snap
220M /tmp
586M /var
16K /lost+found
3.6G /
I suspect something is holding those space in the VM so Windows cannot compact the VHDX file.