Created
November 8, 2021 18:58
-
-
Save flc/cc9cd8856a24a58531cc7aaf1de15231 to your computer and use it in GitHub Desktop.
WSL2 optimize VHD size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsl --shutdown | |
diskpart | |
# open window Diskpart | |
select vdisk file="<path_to_vhdx>" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk | |
exit | |
OR | |
Optimize-VHD -Path your.vhdx -Mode full |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment