How to Install WSL2 on Windows 11

If you’re a developer or someone who loves working with Linux tools, you’ve probably heard about WSL2, the Windows Subsystem for Linux version 2. It’s one of Microsoft’s most powerful integrations — allowing Windows users to run a complete Linux environment without needing dual booting or heavy virtual machines.

With WSL2, you can run Linux commands, build and test code in a Linux environment, use Docker, and even run graphical Linux apps side-by-side with Windows programs. It’s a must-have setup for modern development workflows, especially if you work with technologies like Node.js, Python, Java, or cloud-based tools that perform better on Linux.

In this guide, we’ll walk you through exactly how to install and set up WSL2 on Windows 11, step by step. Let’s dive right in.

What Is WSL2?

WSL2 stands for Windows Subsystem for Linux 2, an updated version of Microsoft’s original WSL. Unlike the first version (which translated Linux calls into Windows calls), WSL2 runs an actual Linux kernel in a lightweight virtualized environment.

That means you get:

  • Real Linux performance with full system call compatibility
  • Seamless integration between Linux and Windows file systems
  • The ability to run Docker containers and Linux-native apps directly on Windows

It’s essentially the best of both worlds — the flexibility of Linux with the stability and UI comfort of Windows. Many developers now use WSL2 as their main Linux environment because it’s simple to install, maintain, and customize.

Step 1: Check System Requirements

Before installing WSL2, make sure your system meets the basic requirements:

  • You must be running Windows 11 (Build 22000 or higher)
  • Virtualization must be enabled in your BIOS/UEFI
  • You should have an internet connection (for downloading the Linux kernel and distro)

To check your Windows build, press Windows + R, type winver, and hit Enter.

Step 2: Enable Required Windows Features

To get WSL2 working, two main features need to be enabled:

  • Windows Subsystem for Linux
  • Virtual Machine Platform

Here’s how to do it:

1. Open PowerShell as Administrator.

2. Type the following commands one after another:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

3. Once done, restart your PC.

This ensures your system is ready to host and run the Linux kernel.

Step 3: Install WSL2 Automatically (Recommended)

Windows 11 makes WSL installation much easier than before. You can now install everything with just one command.

  1. Open PowerShell (Admin) again.
  2. Type the following: wsl --install
  3. Windows will automatically:
    • Enable WSL and Virtual Machine Platform
    • Download the latest WSL2 Linux kernel
    • Install Ubuntu as your default Linux distribution
    • Set WSL2 as the default version

After installation, restart your computer.

When your PC boots up, Ubuntu will launch automatically. You’ll be prompted to create a username and password for your Linux environment.

Step 4: Set WSL2 as the Default Version (Optional)

If you previously installed WSL1 or older Linux distros, you might want to make sure that WSL2 is your default version. Run this command:

wsl --set-default-version 2

To check which version each Linux distro is running, use:

wsl --list --verbose

You’ll see output like this:

NAME      STATE           VERSION
* Ubuntu   Running         2

If any distro shows version 1, you can upgrade it by running:

wsl --set-version <distro-name> 2

Step 5: Install a Linux Distribution Manually

If Ubuntu wasn’t installed automatically, you can manually install your preferred distribution via the Microsoft Store:

  1. Open Microsoft Store.
  2. Search for a Linux distribution like:
    • Ubuntu
    • Debian
    • Kali Linux
    • openSUSE
  3. Click Get or Install.
  4. Launch it from the Start Menu and complete the setup.

Once done, you’ll have a fully functional Linux terminal right on your Windows machine.

Step 6: Test and Verify WSL2 Installation

To verify that everything is installed correctly:

  1. Open Command Prompt or PowerShell.
  2. Run: wsl You should see a Linux shell prompt like user@machine:~$.
  3. To check kernel details: uname -r This confirms that WSL2 is active.

You can now start installing packages, writing shell scripts, or even configuring development environments like Node.js, Python, or Docker directly in your Linux terminal.

Step 7: Update and Maintain WSL2

To keep your WSL environment up to date, run:

wsl --update

This updates the kernel and system components. You can also list and manage distributions using:

wsl --list --online

To uninstall a specific Linux distribution:

wsl --unregister <distro-name>

Conclusion

Setting up WSL2 on Windows 11 opens up an entirely new world of development possibilities. You get the flexibility of Linux right inside your Windows desktop — ideal for coding, server management, or testing scripts.

Whether you’re learning Linux for the first time or building full-stack applications, WSL2 gives you the freedom to do it all without ever leaving Windows. Once you get comfortable using it, you’ll wonder how you ever worked without it!

If your PC feels sluggish or throws errors during setup, it’s a good idea to fix Windows issues and clean up your system before installing WSL2 — this ensures smooth performance and avoids setup errors.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.