Powershell:
Get-AppxPackage -Name "Ubuntu" | Select PackageFamilyName
CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc
Find the *.vhdx file in: %LOCALAPPDATA%/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState
Powershell:
> wsl --shutdown
> diskpart
# open window Diskpart with full path of .vhdx file
> select vdisk file="C:\...\...\ext4.vhdx"
> attach vdisk readonly
> compact vdisk
> detach vdisk
> exit