WSL set default distro

What Does “WSL Set Default Distro” Mean?

When you have multiple Linux distributions installed on your system (e.g., Ubuntu, Debian, Kali, etc.), Windows needs to know which one to launch by default when you type wsl in the command line.

WSL set default distro
Image source: Winaero

The default WSL distro is:

  • The Linux version that launches when you just type wsl
  • The target of integrations like Windows Terminal profiles (unless explicitly set otherwise)
  • The primary environment for scripts that call WSL without specifying a distribution
thumbs up regular

Pros


  • Easily change your primary WSL environment with one command.
  • Scripts and commands using plain wsl will run in your chosen distro automatically.
    Developers can temporarily switch to a clean or isolated distro for testing without disrupting others.
  • Useful for users managing multiple environments (e.g., Ubuntu for dev, Kali for security).
  • Prevents accidental commands running in the wrong distro when multiple are installed.
thumbs down regular

Cons

  • Terminal profiles need to be manually updated if you want them to reflect the new default distro.
    If the default distro is uninstalled, WSL might fail to start or auto-switch to an unintended one.
  • If scripts expect a specific environment, changing the default distro could break them.
  • The command executes silently unless you check with wsl -l -v, which can be confusing.
    Distro names are case-sensitive, leading to potential user errors.
    No built-in GUI for setting the default (unless using third-party tools).

Why You Might Want to Change the Default Distro

  • You installed a newer or preferred distro (e.g., switched from Ubuntu 18.04 to Ubuntu 22.04)
  • You’re testing a script or service and want it to use a specific environment
  • You need different distros for different tasks (e.g., development in Ubuntu, pentesting in Kali)

How to Set the Default WSL Distro

Step-by-step via Command Line:

List your installed distros:

bash

wsl --list --verbose or

bash

wsl -l -v

Set the default:

bash

wsl --set-default <DistroName>

Example:

bash

wsl --set-default Ubuntu-22.04

Verify it worked:
Run:

bash

wsl

It should now open your selected distro.

Common Issues or Gotchas

ProblemExplanationFix
Invalid distro nameYou typed the name wrong (case-sensitive)Use wsl -l -v to copy the exact name
No output on wslDefault distro might be corrupted or not initializedTry reinstalling or setting a different default
WSL2 not usedYour distro may still be running under WSL1Convert using wsl --set-version <DistroName> 2
Different default in Windows TerminalIt may have its own profile settings overriding WSL defaultGo to Windows Terminal → Settings → Profiles

READ ALSO: How to uninstall wsl?

Advanced Usage Tips

  • Use this command inside scripts:

wsl -d <DistroName> — <your command here>

  • Set default in PowerShell script for automation:

wsl.exe –set-default Debian

  • Use wsl.conf inside your distro to customize mounts, networking, etc.
image 1
Image source: Docker Community Forums

Summary

FeatureDetails
Commandwsl --set-default <DistroName>
When to useSwitching preferred Linux environment
Applies toAll WSL versions (1 & 2)
UsefulnessEssential for multi-distro workflows
RiskVery low; reversible anytime

FAQs

What does wsl --set-default do?

It sets the specified Linux distribution as the default WSL environment. When you run wsl without parameters, this distro will open.

How do I check which distro is currently the default?

Run:
wsl -l -v
The default distro will have (Default) next to its name.

What if I get an “Invalid distribution name” error?

Make sure you’re using the exact name listed in wsl -l -v — it’s case-sensitive.

Can I have multiple WSL distros installed?

Yes. You can install multiple distros from the Microsoft Store (e.g., Ubuntu, Debian, Kali) and switch the default anytime.

Will changing the default distro affect my other distros?

No. It only affects which one launches by default. Other distros remain untouched.

Can I open a specific distro even if it’s not the default?

Yes. Use:
wsl -d <Distroname>
Example:
wsl -d Debian

Does this work with both WSL1 and WSL2?

Yes. You can set the default regardless of whether it’s a WSL1 or WSL2 distro.

Does the default distro apply to Windows Terminal too?

Only if you haven’t manually changed the default profile in Windows Terminal. You can override it there.

What happens if I uninstall the default distro?

WSL will either:
Pick another installed distro as default automatically
Or fail to launch until a new default is set

Leave a Reply