Last active
August 21, 2025 08:27
-
-
Save Codes-Lab/ea097868c3064d16dc8d0e93e53885e1 to your computer and use it in GitHub Desktop.
Docker wsl disk size Shrink, Shrink Docker desktop Vdisk in Windows
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 | |
| # make sure everything is stopped | |
| wsl --list --verbose | |
| #Verify everything is stopped by: | |
| >> wsl.exe --list --verbose | |
| #Then start diskpart: | |
| >> diskpart | |
| #and inside diskpart type: | |
| DISKPART> select vdisk file="<path to vhdx file>" | |
| #Then to shrink | |
| DISKPART> compact vdisk | |
| DISKPART> Optimize-VHD -Path "<path to vhdx file>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment