20.06.2025

How to install WSL on Windows?

For native interaction with Windows and Linux, WSL was developed. Where WSL translates Linux system calls into similar Windows calls, allowing applications created for Linux to function in the Windows environment. However, there is an important difference between WSL 1 and WSL 2:

WSL 1 is an emulation of system calls. It creates a Linux user space, where Linux system calls are translated into Windows API calls.

Example: if a Linux program calls fork() or open(), WSL 1 transforms this into the corresponding Windows calls, such as CreateProcess or CreateFile.

WSL 2 is a full-fledged Linux kernel. It uses a virtual machine based on Hyper-V. Inside, a real Linux kernel from Microsoft is launched.

System calls are not translated: everything is done natively, as on a regular Linux machine.

How to install WSL on Windows?

Windows Subsystem for Linux (WSL) is a tool that allows you to run Linux distributions directly on Windows without using virtual machines. WSL is useful for developers and system administrators who want to work in a Linux environment without leaving Windows.

In this guide, we'll cover installing WSL on Windows 10 and Windows 11.

Step 1. Checking your Windows version

Before starting the installation, make sure your Windows version supports WSL:

Check your system version:

winver

Screenshot № 1 — Version

If the version is lower than 2004, update Windows via the update center.

Step 2. Installing WSL via PowerShell

Microsoft has simplified the installation of WSL — now you only need one command:

Run PowerShell as administrator. Run the following command:

wsl --install

The command will automatically:

  1. Enable the necessary Windows components
  2. Install the latest version of WSL (WSL 2)
  3. Download and install Ubuntu by default
  4. After the installation is complete, a system reboot will be required.

Step 3. Install another Linux distribution (optional)

If you want to install another distribution (e.g. Debian, openSUSE, Kali, etc.), run the command:

wsl --list --online

Screenshot № 2 — List of distributions

Select the desired distribution from the list and install it:

wsl --install -d <distribution_name>

Example:

wsl --install -d Debian

Screenshot № 3 — Installation

Step 4. Checking the installed WSL version

To find out which version of WSL is used (WSL 1 or WSL 2):

wsl --list --verbose

If you need to change the version for a specific distribution:

wsl --set-version <distribution_name> 2

Example:

wsl --set-version Ubuntu 2

Step 5. Update the WSL kernel (if necessary)

If an error related to the kernel occurred during installation, download the update from the official Microsoft website:

Screenshot № 4 — Other distributions

Install the downloaded .msi file, then repeat the installation of WSL. It provides a convenient environment for developing and working with Linux tools directly in Windows. With WSL, you can run Docker, use package managers (apt, yum), work with git, and execute Bash scripts.