Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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`.



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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: