WSL

Open Terminal.

wsl --install
  1. Wait, after install, reboot PC

  2. Finally, Open Ubuntu terminal and setup username and password (don't leave it empty)

You can uninstall snap if you dont use it (run inside wsl ubuntu):

bash <(curl -fsSL https://gitlab.com/scripts94/kubuntu-get-rid-of-snap/-/raw/main/Kubuntu_get_rid_of_Snap.sh)

Useful commands

List installed distros

wsl 

Reinstall distro

wsl --unregister <distro-name>
wsl --install -d <distro-name>

WSL takes too much space ?

If you notice your WSL2 is taking too much space even after some clean, here's how you can compact your WSL2 virtual disk on windows (If you're having trouble with automatic, just doit manually)

When this issue will be fixed this part will be useless.

Use wslcompact. If wslcompact did nothing, you can try the following script to compact vdisk:

Invoke-WebRequest -Uri "https://gist.githubusercontent.com/Crackvignoule/fb858118c2b373369741ac084c6c3d45/raw/7598671681ec3513d9c27931d9730f57639f1436/compact-wsl2.ps1" -OutFile "$env:TEMP\compact-wsl2.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\compact-wsl2.ps1"

Last updated