What is WSL? Running Linux on Windows

Author: Published

In brief: WSL (Windows Subsystem for Linux) is a feature of Windows that lets you run a Linux environment without installing it as a separate bootable operating system. It gives you access to a Linux terminal, development tools and many applications while you stay in Windows. For most new uses, the best starting point is WSL 2, which uses a real Linux kernel.

How does WSL work, and what does it actually run?

WSL stands for Windows Subsystem for Linux. It lets you install a distribution: a particular version of a Linux environment with its own set of programs and package manager. Ubuntu is a popular example; its package manager lets you install and update programs using commands.

When you launch Ubuntu in WSL, you primarily get a terminal with a shell, a program that interprets the commands you type. You can browse files, run scripts, install Python or work with Git. This is not just a terminal pretending to be Linux: the programs run in a Linux environment.

Windows and Linux remain separate environments, but they are integrated. From Linux, you can access Windows files, while an editor running in Windows can work with tools installed in WSL. Supported WSL 2 configurations also let you run Linux applications with graphical interfaces, but this does not mean installing a full Linux desktop.

What is WSL useful for?

WSL is particularly useful when you use Windows for everyday work, but a project requires tools commonly used on Linux. Examples include web development, task automation and learning server administration.

For example, suppose you are building an application in Python that will later run on a Linux server. You use your browser and editor in Windows, while installing Python and its dependencies and running the application in Ubuntu under WSL. This gives you a working environment closer to that of the server, although WSL does not guarantee identical behaviour on the target server.

Typical uses include:

If you only use a browser, an office suite and programs available for Windows, installing WSL will usually offer no particular benefit. It is a tool for specific tasks, not an essential system add-on.

How do WSL 1 and WSL 2 differ?

WSL 1 translates Linux system calls into Windows mechanisms and does not run a real Linux kernel. WSL 2 uses a Linux kernel in a lightweight virtual machine managed by Windows. The kernel is the core part of an operating system, responsible for processes, memory and device handling, among other things.

FeatureWSL 1WSL 2
How it worksCompatibility layerReal Linux kernel and virtualization
Compatibility with Linux softwareMore limitationsBroader compatibility
Virtualization requirementsDoes not require hardware virtualizationRequires hardware virtualization to be available and enabled
Typical choiceSpecific needs or constraintsMost new installations

WSL 2 is not faster at every task. File location makes a significant difference: Linux tools working with thousands of small files stored on a Windows drive may run more slowly than when working with files in the Linux file system. For this reason, a project handled mainly by Linux tools is best kept in your WSL home directory.

How do you install WSL and check that it works?

On supported, current releases of Windows 11 and suitably updated releases of Windows 10, the standard method is to use the installation command. Check the official WSL documentation on Microsoft Learn for the requirements for your particular operating system version and the availability of features. On a work computer, administrator policies may block installation.

  1. Open PowerShell or Windows Terminal as an administrator.
  2. Enter wsl --install. By default, this command installs WSL along with Ubuntu.
  3. Restart your computer if the installer requires it.
  4. Open Ubuntu and create a Linux username and password. These are separate from your Windows account; the terminal does not display any characters as you type the password.
  5. In PowerShellu, enter wsl --list --verbose to check which distributions are installed and which WSL version each uses.

After launching Ubuntu for the first time, you can refresh the package list and install available updates with sudo apt update && sudo apt upgrade. sudo runs a command with Linux administrator privileges. This update command applies to Ubuntu and other distributions that use the APT package manager, not to every Linux distribution.

Where should you save files, and what limitations should you keep in mind?

In Ubuntu, you can create a project directory with mkdir -p ~/projects/test. The ~ symbol represents the Linux user’s home directory. The Windows C drive is usually accessible at /mnt/c, and you can open the current Linux directory in Windows File Explorer with explorer.exe ..

WSL does not replace a full Linux installation for every purpose. Direct hardware access, advanced network configuration or testing kernel modules may require additional configuration or a different solution. A virtual machine or a separate Linux installation may be better for learning the complete system boot process and disk management.

WSL 2 uses RAM and disk space, especially when running databases or containers. Do not treat it as a secure sandbox for unknown scripts, either: its integration allows access to Windows files. To get started, run one small project in your Ubuntu home directory and check that the tools you need work correctly.

See also: What is 2FA?

Read also

Learn how PHP-FPM handles PHP requests, how it differs from a web server, and how to tune processes for traffic and hosting resources.
Learn how BIND, open-source DNS server software, handles domains, how its two roles differ and when running it yourself makes sense.
Learn what Poland’s REGON register and identification number mean, how they differ from NIP and KRS, and how to check a business’s details.