Step-by-step guide: Installing and enabling WSL 2 on Windows 10

Learn how to install and enable WSL 2 on Windows 10 with this step-by-step guide. Unlock Linux tools and development capabilities directly on your Windows machine.

Step-by-step guide: Installing and enabling WSL 2 on Windows 10
Photo by Ian Parker / Unsplash

The Windows Subsystem for Linux (WSL) is a game-changer for developers, enabling native Linux functionality within Windows. With WSL 2, Microsoft has significantly improved performance and system compatibility, making it easier than ever to run Linux-based applications without the need for a virtual machine.

This guide walks you through the modern method for installing and enabling WSL 2 on Windows 10, ensuring you take full advantage of its features.

Verify Your Windows Version

Before proceeding, ensure your Windows version supports WSL 2.

Open the Start menu, type winver, and press Enter. A dialog box will appear with your current Windows version and build number.

To install WSL 2, you need:

  • Version: 2004 or later
  • Build: 19041 or later

If your system does not meet these requirements, you’ll need to follow the older installation method.

Enable WSL Using the Command Line

Microsoft has simplified the WSL installation process with a single command.

  1. Open Command Prompt as Administrator: Search for cmd, right-click on Command Prompt, and select Run as administrator.
  2. In the terminal, enter:
wsl --install

This command enables the WSL feature, installs the necessary components, and sets up Ubuntu by default.

Once completed, restart your computer to finalize the setup.

Set WSL 2 as the Default Version

To ensure new distributions use WSL 2 by default, run:

wsl --set-default-version 2

To convert an existing distribution to WSL 2:

wsl --set-version <distro name> 2

Replace <distro name> with the name of your installed distribution (e.g., Ubuntu, Debian).

Install a Linux Distribution

WSL supports multiple Linux distributions, including Ubuntu, Debian, Kali Linux, and more.

View Available Distributions

To list all available distributions:

wsl --list --online

Or use the shorthand:

wsl -l -o

This will return a list of installable distributions with their official names.

NAME                            FRIENDLY NAME
AlmaLinux-8                     AlmaLinux OS 8
AlmaLinux-9                     AlmaLinux OS 9
AlmaLinux-Kitten-10             AlmaLinux OS Kitten 10
Debian                          Debian GNU/Linux
FedoraLinux-42                  Fedora Linux 42
SUSE-Linux-Enterprise-15-SP5    SUSE Linux Enterprise 15 SP5
SUSE-Linux-Enterprise-15-SP6    SUSE Linux Enterprise 15 SP6
Ubuntu                          Ubuntu
Ubuntu-24.04                    Ubuntu 24.04 LTS
archlinux                       Arch Linux
kali-linux                      Kali Linux Rolling
openSUSE-Tumbleweed             openSUSE Tumbleweed
openSUSE-Leap-15.6              openSUSE Leap 15.6
Ubuntu-18.04                    Ubuntu 18.04 LTS
Ubuntu-20.04                    Ubuntu 20.04 LTS
Ubuntu-22.04                    Ubuntu 22.04 LTS
OracleLinux_7_9                 Oracle Linux 7.9
OracleLinux_8_7                 Oracle Linux 8.7
OracleLinux_9_1                 Oracle Linux 9.1

Install a Specific Distribution

To install a distribution of your choice, run:

wsl --install -d <distro name>

For example, to install Debian:

wsl --install -d Debian

Make sure the <distro name> exactly matches the one listed in the NAME column of the previous command.

Update the WSL Kernel

Keeping WSL up to date ensures you have the latest features and security patches.

To update WSL, run the following command as administrator:

wsl --update

This command downloads and installs the latest WSL kernel.

Optimize Your Development Workflow

Once WSL 2 is installed and configured, enhance your development environment with these best practices:

  • Update installed packages regularly inside your Linux distribution
  • Use the Linux file system for development work, accessible via \\wsl$\ in File Explorer
  • Configure your code editor (like VS Code) to open projects directly within your Linux environment
  • Install essential tools such as git, curl, and language-specific package managers (e.g., npm, pip, composer)

For more advanced configuration tips, check out the official Microsoft WSL documentation.

Conclusion

Installing WSL 2 on Windows 10 opens the door to a powerful hybrid development environment. It lets you run full Linux distributions directly within Windows, providing access to Linux tools, terminal utilities, and development workflows — all without leaving your Windows desktop.

With just a few commands, you can set up WSL 2, install your preferred Linux distribution, and start working more efficiently across platforms. Whether you're writing bash scripts, compiling code, or managing servers, WSL 2 provides the flexibility and power of Linux with the convenience of Windows. Give it a try and unlock a new level of development productivity.