The article provides a step-by-step guide on changing the default Linux distribution in the Windows Subsystem for Linux (WSL) on Windows 11. It explains how WSL allows running a GNU/Linux environment directly in Windows and says upon first installation, the first distro becomes the default. A method to change the default distro using specified commands is detailed.
This article explains how one can change the default distro for Windows Subsystem for Linux in Windows 11.
Windows Subsystem for Linux lets developers run a GNU/Linux environment directly in Windows without setting up a virtual machine or dual-boot, including most command-line tools, utilities, and applications.
By default, when you install the first Linux distro in the Windows Subsystem for Linux, it becomes the default Linux distribution.
WSL will use the default Linux distribution to run Linux commands. However, if you have multiple distros installed and want to change the default, the steps below will show you how.
Change WSL default distros in Windows 11
As described above, WSL will use the default Linux distribution to run Linux commands. However, WSL will allow you to change the default when multiple distributions are installed.
Here’s how to do it.
When the Windows Terminal app opens, run the commands below to list the currently installed distros.
wsl --list --all
The command above will output similar lines as the one below.
Windows Subsystem for Linux Distributions: Ubuntu (Default) kali-linux Debian
The example above lists the Ubuntu distro as the default.
To change the default, run the command format as follows.
wsl --setdefault <name of Linux distro>
Replace <name of Linux distro> with the name of the distro you want to make the default.
wsl --setdefault Debian
After running the command above, Debian will become the default distribution.
That should do it!
This post showed you how to change the default WSL Linux distro in Windows 11. Please use the comment form below if you find any errors above or have something to add.