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.
First, open Windows Terminal and select either Windows PowerShell or Command Prompt tab.
When the Windows Terminal app opens, run the commands below to list the currently installed distros.
wsl --list --all
or
wsl -l
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.
Example:
wsl --setdefault Debian
After running the command above, Debian will become the default distribution.
That should do it!
Conclusion:
- Changing the default Windows Subsystem for Linux (WSL) distribution in Windows 11 is straightforward using Windows Terminal.
- Following the provided commands, users can easily list the installed distributions and set a new default distribution for WSL.
- This method allows developers to customize their WSL environment based on their preferences and requirements.
- Applying the outlined steps, experience a seamless transition to a new default Linux distribution for WSL.
Leave a Reply