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





Run Windows Subsystem for Linux (WSL) Distro in Windows 10 OPTION ONE Run Windows Subsystem for Linux (WSL) Distro in Windows 10
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.

Name:  Run_WSL_distro_Start_menu.jpg
Views: 126
Size:  70.4 KB






Run Windows Subsystem for Linux (WSL) Distro in Windows 10 OPTION TWO Run Windows Subsystem for Linux (WSL) Distro in Windows 10
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

Name:  Run_default_WSL_distro_command_prompt.png
Views: 117
Size:  7.4 KB

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


Name:  Run_default_WSL_distro_as_specific_user_command_prompt.png
Views: 121
Size:  7.4 KB

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


Name:  Run_specific_WSL_distro_command_prompt.png
Views: 115
Size:  7.6 KB

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


Name:  Run_specific_WSL_distro_as_specific_user_command_prompt.png
Views: 116
Size:  7.6 KB

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






Run Windows Subsystem for Linux (WSL) Distro in Windows 10 OPTION THREE Run Windows Subsystem for Linux (WSL) Distro in Windows 10
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

Name:  Run_default_WSL_distro_PowerShell.png
Views: 117
Size:  7.6 KB

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


Name:  Run_default_WSL_distro_as_specific_user_PowerShell.png
Views: 116
Size:  7.7 KB

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


Name:  Run_specific_WSL_distro_PowerShell.png
Views: 117
Size:  7.6 KB

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


Name:  Run_specific_WSL_distro_as_specific_user_PowerShell.png
Views: 118
Size:  7.8 KB

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


That's it,
Shawn


Related Tutorials