UiBhelp's public knowledge cards

KI 3734 Install Windows Subsystem for Linux 2 (WSL2)

This guide shows you how to install Windows Subsystem for Linux 2 (WSL2) on a UiB computer running Windows 11, and then how to install a Linux distribution (for example Ubuntu).
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 Center
Click 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.

Software Center – WSL2 klar til installasjon

3. Wait for the installation to start
The status changes to Installing…. You can follow the progress here.

Software Center – installasjonen pågår


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.

Søk etter Terminal i Start-menyen

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.

Liste over tilgjengelige distribusjoner


7. Install the distribution you want
In this example, Ubuntu is installed:
wsl --install -d Ubuntu




The distribution is downloaded and installed.
Ubuntu lastes ned

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.
Opprett standard Unix-brukerkonto


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.

Skriv inn og bekreft passord

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.

Spørsmål om innsamling av plattformdata


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.

Kjør apt update og full-upgrade

12. Confirm the update
You will see a summary of the packages to be upgraded. Press Y and Enter to continue.
Bekreft oppgradering av pakker

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.