References
Microsoft Learn - Advanced settings configuration in WSL (opens in a new tab)
Cheatsheet
DNS config
# wsl.conf
[network]
generateResolvConf=falseSSH into different WSL distributions
- Use different host ports for
sshdof differentWSLdistributions, as allWSLdistributions all have the sameIPaddress.
Docker container exits immediately with code 139
- Add the following content to
%USERPROFILE%\.wslconfigand restartWSL
[wsl2]
kernelCommandLine = vsyscall=emulateGet a list of currently available distributions
wsl --list --onlineInstall a specified distribution
wsl --install %distribution_name%Run a specified distribution
wsl -d %distribution_name%Uninstall a specified distribution
wsl --unregister %distribution_name%Relocate a distribution
wsl --manage %distribution_name% --move %new_location%Example:
wsl --manage fedora --move D:\wsl\fedoraShutdown a distribution
wsl -t %distribution_name%Shutdown all distributions
wsl --shutdownUpdate WSL
wsl --updateGet WSL network mode
wslinfo --networking-modeGet WSL version
# In WSL distro
wslinfo --wsl-version