How to Change the Default WSL Distribution

If you have multiple Windows Subsystem for Linux (WSL) distributions installed on your computer, you may want to change the default distro that opens when you run the wsl command. This is especially useful if you are managing multiple WSL environments and want to switch between them easily. In this post, we’ll show you how to change the default WSL distro in just a few steps.

Check Installed WSL Distros

To view your currently installed WSL Linux distributions, follow these steps:

  1. Open a PowerShell terminal.
  2. Run the following command:
wsl -l -v
list wsl distros

This will list all the Linux distributions you have installed, with a star (*) next to the name of the current default distro.

Set Default WSL Distro

To change the default WSL distro, follow these steps:

  1. Open a PowerShell terminal.
  2. Run the following command, replacing <distro_name> with the name of the Linux distribution you want to set as the default:
wsl -s <distro_name>
set default wsl distro

Note that this will not interrupt an active WSL terminal session if you have one open. You can verify that the default WSL distro has been changed by running the wsl -l -v command again and checking which distribution has the star next to its name.

Similar Posts

Leave a Reply

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