windows
Enable WSL
Run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart # If you want WSL 2 (the latest version of WSL and provides better performance and compatibility with Linux applications), also run this: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Then, restart.
At this point you can install e.g. Ubuntu from the Microsoft Store or another way.
But if you try to open it, it might error:
Installing, this may take a few minutes... WslRegisterDistribution failed with error: 0x800701bc Error: 0x800701bc WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel Press any key to continue...
To fix, you can go to that URL, or just run:
wsl --update
If you ever need to verify your installations, run:
wsl --list --verbose