How to Run a Windows Subsystem for Linux (WSL) Distro in Windows 10


The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop and modern store apps.

When you have Windows Subsystem for Linux (WSL) enabled, you can run the default WSL distro or a specified WSL distro to send commands to.

Starting with Windows 10 build 18342 (19H1) and Windows 10 build 18836 (20H1), Microsoft added some new commands that will give you more functionality when using wsl.exe. The commands that existed inside of wslconfig.exe have been added to wsl.exe to allow you to configure your distros more easily.

See also:

This tutorial will show you different ways to run a Windows Subsystem for Linux (WSL) distro in Windows 10.


 CONTENTS:

  • Option One: Run a Windows Subsystem for Linux (WSL) Distro from Start Menu
  • Option Two: Run a Windows Subsystem for Linux (WSL) Distro from Command Prompt
  • Option Three: Run a Windows Subsystem for Linux (WSL) Distro from PowerShell





OPTION ONE

Run a Windows Subsystem for Linux (WSL) Distro from Start Menu


Running a WSL distribution using its distro-specific app launches that distribution in its own console window.

1. Open All Apps in your Start menu.

2. Perform one of the following actions below for how you want to run the installed WSL distro app (ex: "Debian"). (see screenshot below)

A) Click/tap on the WSL distro app (ex: "Debian").

OR

B) Right click/tap on the WSL distro app (ex: "Debian"), click/tap on More, and click/tap on Run as administrator.

Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_wsl_distro_start_menu.jpg






OPTION TWO

Run a Windows Subsystem for Linux (WSL) Distro from Command Prompt


1. Open a command prompt or elevated command prompt.

2. Enter the command you want to use below into the command prompt to run the installed or imported WSL distro app you want. (see screenshots below)

(Run default WSL distro)
wsl

Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_default_wsl_distro_command_prompt.png

OR

(Run default WSL distro as a specific user)
wsl -u <Username> OR wsl --user <Username>

Substitute <Username> with the name of the user you want to run this WSL distro as. Please note that user must exist inside of the WSL distribution. This will not be a Windows 10 user account.

For example: wsl --user brink


Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_default_wsl_distro_as_specific_user_command_prompt.png

OR

(Run specific WSL distro)
wsl -d <DistributionName> OR wsl --distribution <DistributionName>

Substitute <DistributionName> with the name of an available WSL distro (ex: "Debian") you want to run.

For example: wsl --distribution Debian


Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_specific_wsl_distro_command_prompt.png

OR

(Run specific WSL distro as a specific user)
wsl -u <Username> -d <DistributionName> OR wsl --user <Username> --distribution <DistributionName>

Substitute <Username> with the name of the user you want to run this WSL distro as. Please note that user must exist inside of the WSL distribution. This will not be a Windows 10 user account.

Substitute <DistributionName> with the name of an available WSL distro (ex: "Debian") you want to run.

For example: wsl --user brink --distribution Debian


Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_specific_wsl_distro_as_specific_user_command_prompt.png

3. When finished, you can close the command prompt if you like.






OPTION THREE

Run a Windows Subsystem for Linux (WSL) Distro from PowerShell


1. Open a PowerShell or elevated PowerShell.

2. Enter the command you want to use below into PowerShell to run the installed or imported WSL distro app you want. (see screenshots below)

(Run default WSL distro)
wsl

Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_default_wsl_distro_powershell.png

OR

(Run default WSL distro as a specific user)
wsl -u <Username> OR wsl --user <Username>

Substitute <Username> with the name of the user you want to run this WSL distro as. Please note that user must exist inside of the WSL distribution. This will not be a Windows 10 user account.

For example: wsl --user brink


Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_default_wsl_distro_as_specific_user_powershell.png

OR

(Run specific WSL distro)
wsl -d <DistributionName> OR wsl --distribution <DistributionName>

Substitute <DistributionName> with the name of an available WSL distro (ex: "Debian") you want to run.

For example: wsl --distribution Debian


Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_specific_wsl_distro_powershell.png

OR

(Run specific WSL distro as a specific user)
wsl -u <Username> -d <DistributionName> OR wsl --user <Username> --distribution <DistributionName>

Substitute <Username> with the name of the user you want to run this WSL distro as. Please note that user must exist inside of the WSL distribution. This will not be a Windows 10 user account.

Substitute <DistributionName> with the name of an available WSL distro (ex: "Debian") you want to run.

For example: wsl --user brink --distribution Debian


Run Windows Subsystem for Linux (WSL) Distro in Windows 10-run_specific_wsl_distro_as_specific_user_powershell.png

3. When finished, you can close PowerShell if you like.


That's it,
Shawn


Related Tutorials