How to Change Default WSL Distro in Windows 11
In this article
Yes, you can change the default Linux distribution (distro) in Windows Subsystem for Linux (WSL) on Windows 11. By default, WSL launches the last installed distro, but you can manually set a different one as the default using a simple command in PowerShell or Command Prompt. This change ensures that when you type wsl in the terminal, it opens your preferred distro without extra flags.
What You'll Need
- A Windows 11 PC with WSL installed and at least two Linux distributions installed via the Microsoft Store or manually
- Administrative access to run commands in PowerShell or Command Prompt
- Basic familiarity with command-line tools
Step-by-Step
- Open the Start menu and search for "PowerShell". Right-click on Windows PowerShell and select "Run as administrator" to ensure you have the necessary permissions. Alternatively, you can use Command Prompt with admin rights.
- In the PowerShell window, type the following command and press Enter to list all installed WSL distributions:
This will display a table showing the name of each installed distro, its WSL version (1 or 2), and current state (e.g., Running or Stopped).wsl --list --verbose - Identify the exact name of the distro you want to set as default. Names are case-sensitive and may include spaces or special characters depending on how they were installed (e.g.,
Ubuntu-22.04,Debian,Kali Linux). - Run the following command, replacing
[DistroName]with the full, exact name of your desired default distro:
For example, to set Ubuntu-22.04 as the default:wsl --set-default [DistroName]wsl --set-default Ubuntu-22.04 - After running the command, verify the change by typing:
The default distro does not have a special marker, but you can confirm it’s working by simply typingwsl --list --verbosewsland checking which distro launches. - Optionally, test the change by closing all WSL sessions and opening a new PowerShell or Command Prompt window. Type
wsland press Enter. It should now launch your newly set default distro.
Common Mistakes
- Typing the distro name incorrectly: WSL distro names are case-sensitive and must match exactly. For example,
ubuntuwill not work if the actual name isUbuntu-22.04. - Forgetting to run PowerShell as administrator: While not always required, running as admin avoids permission issues, especially if system-level changes are involved.
- Using an outdated command: Some older guides suggest
wsl --set-default-version, which sets the WSL version (1 or 2), not the default distro. This is a different setting and won’t change which distro launches by default. - Assuming the default changes automatically: WSL does not auto-select your most used distro. You must manually set it using the command.
Tips
- Use tab completion in PowerShell: After typing
wsl --set-default, you can press Tab to cycle through installed distro names, helping avoid typos. - Keep distro names handy: Run
wsl --listanytime you’re unsure which distros are installed. - Set default during setup: When installing a new distro, consider setting it as default immediately afterward if you plan to use it most often.
- Use WSL 2 for better performance: While not required for changing the default, ensure your preferred distro is using WSL 2 for improved file system performance and full system call compatibility.
Troubleshooting
If the default distro does not change or you get an error, follow these steps in order:
- Check for typos: Re-run
wsl --list --verboseand double-check the exact spelling and capitalization of the distro name. - Ensure WSL is initialized: If you just installed a distro, launch it once manually by typing
wsl -d [DistroName]to complete first-run setup before setting it as default. - Update WSL: Run
wsl --updatein PowerShell (as admin) to ensure you have the latest version of the WSL kernel and tools. - Restart WSL: Shut down WSL completely with
wsl --shutdown, then try setting the default again. - Check Windows version: Ensure your Windows 11 is updated to a recent build. Older versions may have limited WSL support.
- Reinstall the distro: If a distro fails to launch or register, uninstall it via Settings > Apps > Installed apps, then reinstall from the Microsoft Store.
Frequently Asked Questions
Can I change the default WSL distro without admin rights?
Generally, no. While some WSL commands work without elevation, setting the default distro may require administrative privileges to modify system-level configurations.
Does changing the default affect all users on the PC?
No. The default WSL distro is set per user account. Each user on the same machine can have a different default distro.
What happens if I uninstall the default distro?
If you uninstall the current default distro, WSL will not launch when you type wsl. You’ll need to set a new default using wsl --set-default with an installed distro.
Can I use a custom or manually installed distro as default?
Yes. As long as the distro is registered with WSL (visible in wsl --list), you can set it as default regardless of whether it came from the Microsoft Store or was imported manually.
Is there a GUI way to change the default WSL distro?
Not directly. Microsoft does not provide a built-in GUI setting for this. You must use the command line. Third-party tools like Windows Terminal allow profile selection but don’t change the global WSL default.
Will changing the default distro affect WSL 1 vs WSL 2 settings?
No. The default distro and WSL version are separate settings. You can have a WSL 2 distro as default while other distros run under WSL 1.