To compact a vhdx file via command line (PowerShell)
> mount-VHD -Path c:\VM\virtual_machine.vhdx -ReadOnly
> optimize-VHD -Path c:\VM\virtual_machine.vhdx -Mode Full
> dismount-VHD -Path c:\VM\virtual_machine.vhdx
References:-
To compact a vhdx file via command line (PowerShell)
> mount-VHD -Path c:\VM\virtual_machine.vhdx -ReadOnly
> optimize-VHD -Path c:\VM\virtual_machine.vhdx -Mode Full
> dismount-VHD -Path c:\VM\virtual_machine.vhdx
References:-
Kimmy you are awesome! Huge +1! Finally a real working solution to the Linux compact VHDX issue..
Thanks!
Thanks for your encouraging response. Glad that the information helped you. 🙂