How to Set a Default Linux Distribution in WSL
This post is to help guide you on how to set your default Linux Distribution in Windows Subsystem for Linux (WSL). A useful command to know if you are managing multiple WSL Distros.
First up, run the following to list your installed WSL Distributions and versions –
# get installed wsl distros wsl -l -v
The star at the Distro name indicates the current Default Distro. If we enter WSL by running wsl, we will logon to the Ubuntu-20.04 Distro.
To set the default Linux distro, run wsl -s <wsl-distribution-name>, entering your Distro name as per the name in the previous (wsl -l -v) command.
# set default wsl distribution (as per 'wsl -l' name) wsl -s <wsl-distribution-name>
When we enter WSL, we can show system information to confirm what distro of Ubuntu we are in by running lsb_release -a