How to Change Default Distro in Windows Subsystem for Linux
Changing your default Linux distribution in Windows Subsystem for Linux (WSL) lets you pick which Linux environment opens first when you type `wsl`.
WSL allows you to run Linux command-line tools right on your Windows PC. It provides a simple Linux environment without needing a full virtual machine. When you install your first Linux distro, like Ubuntu, it automatically becomes the default.
If you later install other distros, such as Debian or Fedora, you might want to set a different one as the default. This quick setting change means the `wsl` command will immediately open your preferred Linux version. It also won’t affect any other Linux distros you have installed.
Open Windows Terminal or PowerShell as administrator and use wsl –set-default to change your default Linux distribution. Run wsl –list –verbose first to see your installed distro names.
Understanding WSL Versions
Understanding WSL Versions: Windows Subsystem for Linux comes in two main versions, WSL 1 and WSL 2. WSL 2 offers better speed and includes a full Linux kernel.
| 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
Changing your default WSL distro is done with a single command. This ensures the correct Linux system starts automatically when you open WSL, saving you the step of picking it each time. First, open Windows Terminal or PowerShell as an administrator.
- 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.
What happens to my files when I change the default WSL distro?
When you change your default WSL distro, none of your files are deleted or moved. Your data stays safe inside each Linux system's own virtual storage. You can still get to files in your other Linux systems by using their specific commands or by finding them through Windows File Explorer.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.
No comments yet — be the first to share your thoughts!