Menu & Search
How to Change Default Linux Distro in WSL

How to Change Default Linux Distro in WSL

This post is a guide on how to change your default Linux distribution in Windows Subsystem for Linux (WSL). This is useful when you are managing multiple WSL distros on your machine.

First up, we want to display your installed WSL distributions and versions by running the following command –

# show installed wsl distros & versions
wsl -l -v
Get WSL Versions

The star at the distro name indicates the current default distro. When we enter WSL by running the ‘wsl‘ command, we will log into the Ubuntu-20.04 Distro.

WSL enter Default Distro

We can run lsb_release -a as above to verify which Linux distribution we are on.

To set the default Linux distro we need to run ‘wsl -s <wsl-distribution-name>‘. Amend the WSL distribution name as per what is shown in the ‘wsl -l -v‘ command.

# show installed wsl distros & versions
wsl -l -v

# set default wsl distribution (as per 'wsl -l' name)
wsl -s <wsl-distribution-name>
wsl default distro

Noticing here the same ‘lsb_release -a‘ command does not work for me when in the Debian distro – using ‘cat /etc/os-release’ instead.

That’s it for this one and is all you should need to know on changing your default WSL distribution!

Share

0 Comments