Do you have a Linux VM on a Hyper-V with a bloaty .VHDX?
Then you are on the right page, follow these instructions down below:
The idea is you need to TRIM your thin-provisioned drive first before you can compact your .VHDX
Run fstrim on the Linux system.
fstrim has become my personal...