How to Set Your Default Linux Distribution on Windows 10

You’re free to run multiple Linux environments at once, but your default environment is used when you run a command like wsl.exe or bash.exe to launch the shell, or when you use wsl [command] or bash -c [command] to run a command from elsewhere in Windows.
How to Set Your Default Linux Distribution
The wslconfig.exe command lets you manage the Linux distributions running via the Windows Subsystem for Linux, or WSL.
To run it, you need to open either a Command Prompt or PowerShell window. To open a Command Prompt window, open the Start menu, type “cmd”, and then click the “Command Prompt” shortcut. To open a PowerShell window, right-click your Start button (or press Windows+X), and then select the “Windows PowerShell” command.
To view your installed Linux distributions, type the following command and hit Enter:
Code: Select all
wslconfig /l
If you don’t see an installed Linux distribution in this list, you’ll first need to launch it. Wait for the “Installing, this may take a few minutes…” process to complete. When it’s done, the Linux distribution will appear in this list.

Code: Select all
wslconfig /setdefault [i]Name[/i]
Code: Select all
wslconfig /setdefault Ubuntu

Your default Linux distribution is also used when you run individual commands with either wsl command or bash -c command..

You can run a Linux environment even if it isn’t your default. For example, you can launch the Ubuntu, openSUSE Leap, and SUSE Linux Enterprise Server shortcuts from your Start menu and you’ll have all three separate environments running at the same time.

- Ubuntu: ubuntu
- openSUSE Leap 42: opensuse-42
- SUSE Linux Enterprise Server 12: sles-12

Code: Select all
distro-command -c command
For example, to run the apt-get moo command that shows an Easter egg on Ubuntu, you’d run the following command:
Code: Select all
ubuntu -c apt-get moo

As always, Thank You for your time and I hope you found this Tutorial of interest.Please Note: I have NOT tried this myself so proceed at your own risk.
Links that are provided in my posts are for you to get more in depth info on the subjects,WARNING: Before doing anything involving the Registry or Command prompts always do a backup first...
Please use them; they are there for your help.
Let me know what you think.
