How to Change Default Distro in Windows Subsystem for Linux
You can change your default Linux distribution in Windows Subsystem for Linux (WSL) to quickly launch your preferred environment.
WSL allows you to run Linux command-line tools directly on Windows without a traditional virtual machine. When you install your first Linux distro, like Ubuntu, it automatically becomes your default.
If you install additional distros, such as Debian or Fedora, you might want to switch the default so that typing `wsl` in your terminal opens your newly installed or preferred Linux version first.
This ensures your command line workflow is efficient, launching your chosen Linux environment instantly. Changing the default does not affect your other installed Linux distributions or your files within them.
Understanding WSL Versions
WSL has two main versions: WSL 1 and WSL 2. WSL 2 is faster and uses a real Linux kernel. You can check your versions using the wsl --list --verbose command. This is often shortened to wsl -l -v.
| Command Output | Meaning |
|---|---|
| (Default) | The distro that opens when you type wsl |
| Stopped | The distro is not currently running |
| Running | The distro is active in the background |
How to Change Your Default WSL Distro
Follow these steps to update your settings. Note: This process requires admin privileges. You should run your terminal as an administrator to avoid permission errors.
- Open Windows Terminal or PowerShell.
- Right-click the icon and select Run as administrator.
- Type the following command to see your installed distros:
wsl --list --verbose - Identify the name of the distro you want to set as default.
- Run the following command to change it:
wsl --set-default <DistroName> - Replace <DistroName> with your chosen distro, for example:
wsl --set-default Ubuntu
Summary
Changing your default Linux distribution in WSL is a quick way to manage your development environment. By using the wsl --set-default command, you ensure the right system opens every time. Remember to use wsl -l -v to verify your settings and always run your terminal as an administrator for the best results.
What happens to my files when I change the default WSL distro?
Changing your default WSL distribution does not delete or move your files. Your data remains stored within the virtual disk of each specific distribution. You can still access files in your non-default distributions by using the specific command for that distro or by navigating through the Windows file explorer network path.
Can I run multiple distributions simultaneously?
Yes, you can run multiple Linux distributions at the same time. WSL is designed to handle several environments independently. Each distribution runs in its own isolated space, allowing you to use different versions of Linux for different projects without them interfering with each other or your main Windows system.
How do I change the default user for a specific distribution?
To change the default user, you must edit the configuration file inside the distribution. For example, in Ubuntu, you can edit the /etc/wsl.conf file. Add a [user] section and specify the default username. After saving the file, restart the WSL instance using the wsl –shutdown command to apply the changes.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!