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
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.
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.Run the command
wsl
on Windows command prompt to launch the WSL shell.This will start the Ubuntu 22.04 installation.
After the Ubuntu is installed, WSL will prompt you to setup an username and password for the Ubuntu installation. Ensure to remember these credentials.
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.