Remix.run Logo
acemarke 3 days ago

I recently used https://github.com/okibcn/wslcompact to shrink a couple of WSL VHDX files, and it worked great.

Looking at the source, it seems to use a `wsl --export` option rather than `diskpart`.

twilight-code 2 days ago | parent [-]

Exporting and re-importing the WSL distro is simpler and usually preferred. The tutorial and script are based on this conversation: https://superuser.com/questions/1606213/how-do-i-get-back-un... which mentions some issues with the re-import that includes the need to reset the default username.