Installation
Windows
wsl --install
wsl --updateUsage
# Install a distro
wsl --install -d <distro-name> --name <custom-name># List all distros
wsl --list --all --verbose
# List distros available to install
wsl --list --online# Shutdown specified distro
wsl --terminate <distro-name>
# Shutdown all running distros
wsl --shutdown# Uninstall an existing distro
wsl --unregister <distro-name># Update WSL
wsl --updateTroubleshoot
Network
Blocked by WireGuard
The host machine have wireguard running
The WSL is unable to connect to the internet
Update WireGuard Allowed List
WireGuard → Tunnel → Edit
Untick “Block untunneled traffic (kill-switch)”
Previous Value
AllowedIPs = 0.0.0.0/0, ::/0
New Value
AllowedIPs = 0.0.0.0/1, 128.0.0.0/1, ::/1, 8000::/1
Config
Path
By default WSL will add current Windows Path
Open /etc/wsl.conf inside the distribution
Update appendWindowsPath to false to disable this setting.
[interop]
appendWindowsPath=falseNetwork
By default WSL will use NAT networking mode
Open $HOME/.wslconfig in host machine
Update appendWindowsPath to false to disable this setting.
[wsl2]
networkingMode=mirroredStartup
To start WSL during Windows startup
@'
pwsh -c "clear; wsl -d NixOS --cd \"~\""
'@ > "$HOME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\startup-wsl.bat"