Set Default WSL Linux Distro in Windows 10

A default WSL Linux distro is a distro that runs when you issue the "wsl" command without parameters. Also, it opens from the "Open Linux here" context menu command. Today, we will see how to change this distro.

The ability to run Linux natively in Windows 10 is provided by the WSL feature. WSL stands for Windows Subsystem for Linux, which initially, was limited to Ubuntu only. Modern versions of WSL allow installing and running multiple Linux distros from Microsoft Store.

Linux Distros Microsoft Store Windows 10

After enabling WSL, you can install various Linux versions from the Store. You can use the following links:

  1. Ubuntu
  2. openSUSE Leap
  3. SUSE Linux Enterprise Server
  4. Kali Linux for WSL
  5. Debian GNU/Linux

and more.

The default WSL distribution is the one that runs when you run wsl on a command line. It opens when you are using the context menu command "Open Linux Here" in File Explorer. Tip: You can remove that context menu entry.

To set the default WSL Linux distro in Windows 10,

  1. Open a new command prompt.
  2. Find available WSL distros by executing the following command: wls --list --all, or simply wsl -l --all.Windows 10 List WSL Distros
  3. The current default WLS distro is labeled (Default). To set a new default WSL distro, execute the command: wsl --setdefault <DistributionName>, or wsl --s <DistributionName>.
  4. Substitute <DistributionName> with the actual name of the a WSL distro installed on your computer, for example kali-linux.Windows 10 Set Default WSL Distro

You are done!

Windows 10 Versions Earlier Than Version 1903

If you are running a Windows 10 version earlier than Windows 10 version 1903, you should use the wslconfig utility instead of wsl.

  1. Open a new command prompt.
  2. To see the available Linux distros, run wslconfig /list /all or wslconfig /l /all.Windows 10 List WSL Distros Wslconfig
  3. To set a new default WSL distro with wslconfig, execute the command: wslconfig /s <DistributionName> or wslconfig /setdefault <DistributionName>.
  4. Substitute the <DistributionName> portion with the actual name of the a WSL distro installed on your computer, for example Ubuntu.Windows 10 Set Default WSL Distro Wslconfig

That's it.

Articles of interest:

Leave a Reply

Your email address will not be published. Required fields are marked *