Install Windows Subsystem for Linux

Windows Subsystem for Linux WSL has Ubuntu LTS releases among other Linux distros on the Microsoft Store. The Microsoft Store is the recommended method to install WSL.

If the Microsoft Store isn’t available on the computer, manual WSL install is also available. The WSL changelog shows the continually expanding WSL feature set.

WSL can use GUI and sound with programs like Spyder via WSLg.

List WSL distros already installed on the computer from PowerShell / Command Prompt:

wsl --list --verbose

Install, list, and switch between Linux distros on Windows default for bash from Command Prompt:

wslconfig

WSL configuration

Limit the amount of RAM WSL2 can use by editing Windows file $HOME/.wslconfig to include:

[wsl2]
swap=0
memory=4GB

Set memory= to less than the total computer physical RAM to help avoid using Windows swap.

A WSL default that is confusing and slows down WSL program-finding is stuffing Windows PATH into WSL PATH. We normally disable Windows PATH injection into WSL, because it also breaks library finding in build systems like CMake. Additionally, we enable filesystem metadata, as weird permission errors can occur, even causing CMake to fail to configure simple projects.

[interop]
enabled=false
appendWindowsPath=false

Run Ubuntu apps from Windows Command Prompt or PowerShell:

wsl ls -l

Run Windows program from Ubuntu terminal:

/mnt/c/Windows/System32/notepad.exe

Note that capitalization matters and .exe must be at the end.