I am having issues with too much space utilized by docker and wsl2 *.vhdx images.
tried running:
docker system prune --all
Restarting the pc.
Still the vhdx images are too big. In my case the image size grown up to 250GB!
Turns out there is a way to shrink the vhdx images properly in windows:
docker system prune
(optional —all
), to clean up disk spacewsl --shutdown
Optimize-VHD -Path "$env:LOCALAPPDATA\Docker\wsl\data\ext4.vhdx" -Mode Full
, this will resize the vhdx imagesSame way you can try to find vhdx images that utilize too much space and optimize them as well. You can use TreeSize(Bing it: Tree Size Windows) to find which image takes the most of the space and optimize them.
P.S. dont forget to run docker system prune