- Published on
Shrink virtual disk on WSL
- Moch Lutfi
Since last year I'm using laptop with windows OS and using WSL. Unfortunately my SSD is small and need more space to install warzone lol. After clean up everything in Ubuntu WSL, the disk space not reduced at all. After googling, I found out that I need manually shrink the virtual disk.
Open windows terminal using administrator privilege then follow these command below.
_9wsl --shutdown_9diskpart_9# open Diskpart in new window_9# replace this part with your target vhdx_9select vdisk file="%LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx"_9attach vdisk readonly_9compact vdisk_9detach vdisk_9exit
If you are using ubuntu, find the *.vhdx files in
%localappdata%\Packages\CanonicalGroup... which mean
... can be random string. The processing time depends on the size of virtual disk.