KI 3734 Install Windows Subsystem for Linux 2 (WSL2)
Note: The installation requires a restart, and your computer will restart several times. Save your work and close any open programs before you begin.
Part 1 – Install WSL2 from Software Center
1. Open Software CenterClick the Start button, search for Software Center and open the program.
2. Find and install "Windows Subsystem for Linux 2 for Win 11"
Go to Applications and select Windows Subsystem for Linux 2 for Win 11. Click Install.
Note that it says Restart required: Yes. Your computer will need to restart during the installation.
3. Wait for the installation to start
The status changes to Installing…. You can follow the progress here.
4. Follow the installation window
A window from the University of Bergen shows the progress. Among other things, Microsoft Defender for Endpoint plug-in for WSL is installed. Your computer will restart several times.
Under Installation status in Software Center, WSL2 is shown with the status Installing.
Part 2 – Install a Linux distribution
Once WSL2 has finished installing, you need to install a Linux distribution.5. Open Terminal
Click Start, search for terminal and open the Terminal app.
6. See which distributions are available
Type the following command and press Enter:
wsl -l --online
You will see a list of distributions that can be installed. The NAME column shows the name to use in the install command.
7. Install the distribution you want
In this example, Ubuntu is installed:
wsl --install -d Ubuntu
The distribution is downloaded and installed.
8. Create a Linux user
When the installation is complete, Ubuntu starts automatically and asks you to create a default Unix user account. Type the username you want and press Enter.
9. Choose a password
Enter a password, then confirm it by typing it again.
Tip: No characters are shown while you type the password. This is completely normal.
This password is used when you run commands with sudo in Linux. It is not linked to your UiB password.
Remember your password! You will need it every time you install software or make changes in Linux using sudo. If you forget it, you can reset it. See Forgot your Linux password? at the bottom.
10. Answer the data collection question
Ubuntu asks whether you want to share anonymous system reports with Canonical. Type n for no (or y for yes) and press Enter. You will only be asked once.
Part 3 – Update your Linux installation
11. Run updates
You are now inside Ubuntu. It is recommended to update the system right away:
sudo apt update && sudo apt full-upgrade
Enter the Linux password you created in step 9 when prompted.
12. Confirm the update
You will see a summary of the packages to be upgraded. Press Y and Enter to continue.
Starting WSL
The next time you want to use Linux, open Terminal and type:wsl
or start a specific distribution:
wsl -d Ubuntu
Forgot your WSL Linux password?
You can set a new password yourself, without administrator rights in Windows.
1. Open Terminal and check the name of your distribution:
wsl -l -v
2. Start the distribution as root (replace Ubuntu with the name from the list if you use a different distribution):
wsl -d Ubuntu -u root
3. Set a new password for your Linux user (replace username with the username you created in step 8):
passwd username
If you don't remember your username, you can find it with ls /home.
4. Enter the new password twice, then type exit to leave the root session.
The text is AI generated and modified by a TopDesk operator.