If you want to use Linux without dual-booting or using a virtual machine, WSL (Windows Subsystem for Linux) is a great option. WSL allows you to install and run different Linux distributions on your Windows machine, giving you access to a variety of Linux tools and applications right from the Windows Terminal (Command Prompt or PowerShell)
By default, WSL installs Ubuntu as the default distribution. If you want, you can change or set another Linux distro as default in WSL in just a few steps. For example, if you prefer to use a different Linux distribution such as Debian, CentOS, or Fedora, or if you need a specific version of a distribution that is not available by default, you can change the default WSL distribution to meet your requirements. You can set any Linux distro as default from Command Prompt or PowerShell.
In this quick and easy guide, let me show you the steps to set the default distro in WSL.
Important note: Before proceeding, ensure that the default distro you want to set as the default is installed in WSL.
Related: How to install WSL on Windows
Set Default Distro in WSL
Follow these steps to set the default distro in WSL using Windows Terminal:
Step 1: Open the Windows Terminal app.
First, right-click on the Start icon and select the Terminal (Admin) option. This action opens Windows Terminal with Admin rights. You can also search for Terminal in the Start menu, right-click on the result and select the Run as Administrator option.
Step 2: Check and list all installed distributions.
Next, run the below command to check and list all the installed Linux distributions on your computer.
wsl --list --all
Step 3: Copy the Linux distro name.
From the list, note down or select and copy the name of the Linux distro you want to set as default. For instance, if you want to set Debian as the default WSL distro, copy that name. It is important that you copy the entire name, including the version number (if available).
Step 4: Set your preferred Linux distro as the default.
Once you have the distro name, run the below command while replacing “distro_name” with the distro name you copied or noted down.
wsl --set-default distro_name
For example, to set Debian as the default distro in WSL, enter the following command:
wsl --set-default Debian
Step 5: Verify the default distribution.
Finally, verify if you successfully changed the default distro in WSL by running the below command. Your default distro will be at the top and is tagged with “(Default).”
wsl --list --all
Step 6: (Optional) Uninstall unwanted distributions
If you want to uninstall a Linux distro from WSL, you can do so by entering the following command in the Windows Terminal, replacing “distro_name” with the name of the Linux distro you want to uninstall:
wsl --unregister distro_name
For example, if you want to uninstall the Ubuntu distribution, enter the following command:
wsl --unregister Ubuntu
Step 7: Close the Terminal window.
Finally, close the Terminal window by clicking the ‘X’ icon on the window’s top-right corner.
That is it. With that, you’ve successfully set a default WSL distro on Windows. The above steps work in Windows 10 and 11.
I hope this simple and easy Windows how-to guide helped you.
If you are stuck or need help, email me, and I will try to help as much as possible.