Main Content

Setting Up Windows Subsystem for Linux (WSL2)

Note

This step is required only if you have not setup the username and password for your WSL2 installation after you have installed it for the first time.

Configure Ubuntu 22.04 in WSL2

  1. After the WSL2 is installed for the first time in your computer by following the instructions from this documentation, you need to configure the WSL2 with a username and password.

  2. Open the Windows Command Prompt again as a regular user (not as an administrator). You can do this by pressing the Windows Start key, typing cmd, and then pressing Enter key.

  3. Run the command wsl on Windows command prompt to launch the WSL shell.

    This will start the Ubuntu 22.04 installation.

  4. After the Ubuntu is installed, WSL will prompt you to setup an username and password for the Ubuntu installation. Ensure to remember these credentials.

  5. Set the "Ubuntu" distribution as default. Run the following command to set Ubuntu distribution as default.

Launch WSL2 shell

There are multiple ways to launch a WSL2 shell.

Option 1: Using Windows command prompt.

In Windows command prompt, type wsl to launch the shell.

Option 2: Search wsl or Ubuntu in Windows Search

In Windows Search look for WSL app or Ubuntu app.