How to Install WSL2 on Windows 11: A Step-by-Step Guide

Have you ever wanted to run Linux commands on your Windows machine without the hassle of dual-booting or setting up a separate virtual machine? That’s where WSL2 (Windows Subsystem for Linux 2) comes in. It’s like having the power of Linux right inside your Windows 11 computer—no complicated setups, no messy installations.

In this guide, I’ll walk you through how to install WSL2 on Windows 11 step by step. Whether you’re a developer, a student, or just a curious tech enthusiast, this tutorial will make it easy for you.


What is WSL2?

WSL2 is Microsoft’s improved version of the Windows Subsystem for Linux. It allows you to run a full Linux kernel on your Windows system without needing a separate computer or virtual machine.

Why WSL2 is Better Than WSL1?

  • True Linux kernel for better compatibility.

  • Improved performance for file operations and system calls.

  • Full support for Docker and containers.

  • Easier to integrate with Windows tools.

Think of WSL1 as a translator between Windows and Linux, while WSL2 is like having a Linux roommate who lives inside your Windows home.


Why Install WSL2 on Windows 11?

Still wondering why you should install it? Here’s why WSL2 is a game-changer:

  • Run Linux commands and tools natively.

  • Use Git, Node.js, Python, and other development tools seamlessly.

  • Build and test web apps, servers, and Docker containers.

  • Access the best of both worlds—Linux and Windows side by side.


Prerequisites Before Installing WSL2

Before diving in, make sure you meet the requirements:

  1. Windows 11 (any edition) – Home, Pro, or Enterprise.

  2. 64-bit architecture – WSL2 doesn’t work on 32-bit.

  3. Admin rights – You’ll need to run some commands as administrator.

  4. Internet connection – Required to download Linux distributions.


Method 1: The Easy Way (Automatic Installation)

Microsoft has made installing WSL2 incredibly easy on Windows 11. Just one command, and you’re set.

Steps:

  1. Open PowerShell as Administrator

    • Press Win + S, type “PowerShell,” right-click it, and select Run as administrator.

  2. Run the Command
    Type:

    wsl --install

    This command:

    • Enables the necessary features.

    • Installs WSL2 as the default.

    • Downloads Ubuntu (by default).

  3. Restart Your Computer
    Once installation completes, restart your PC when prompted.

  4. Set Up Your Linux Distro
    After reboot, Ubuntu (or your chosen distro) will launch automatically.

    • Set a username.

    • Create a password.

    • Done!

That’s it—WSL2 is now running on your Windows 11.


Method 2: Manual Installation (Step-by-Step)

If you want more control, you can install WSL2 manually.

Step 1: Enable Windows Subsystem for Linux

  1. Open PowerShell as Administrator.

  2. Run:

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

Step 2: Enable Virtual Machine Platform

Run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 3: Restart Your PC

Restart to apply the changes.

Step 4: Set WSL2 as Default

wsl --set-default-version 2

Step 5: Install a Linux Distro

Open the Microsoft Store, search for a distro (e.g., Ubuntu, Debian, Kali Linux), and click Install.

Step 6: Launch and Configure

After installation:

  • Launch the distro.

  • Create a username and password.

  • You’re good to go!


How to Check WSL Version

Wondering which version you’re running? Use this:

wsl --list --verbose

You’ll see something like:

NAME STATE VERSION
Ubuntu Running 2

How to Upgrade from WSL1 to WSL2

Already have WSL1 and want to upgrade? Easy:

  1. Make sure WSL2 is installed (see Method 1 or 2).

  2. Run:

    wsl --set-version <distro name> 2

    Example:

    wsl --set-version Ubuntu 2

How to Set a Default Linux Distro

If you have multiple distros installed:

wsl --set-default <distro name>

Example:

wsl --set-default Ubuntu

How to Uninstall WSL2 in Windows 11

If you no longer need it:

  1. Uninstall your Linux distro from Settings > Apps.

  2. Disable WSL and Virtual Machine Platform:

    dism.exe /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux
    dism.exe /online /disable-feature /featurename:VirtualMachinePlatform

Common WSL2 Issues and Fixes

1. WSL2 Installation Failed

  • Make sure Virtualization is enabled in BIOS.

  • Update Windows 11 to the latest version.

2. Linux Distro Won’t Launch

  • Run PowerShell as Admin and type:

    wsl --set-default-version 2

3. Network or Internet Not Working

  • Restart your PC.

  • Reset your network settings.


Can I Use Docker with WSL2?

Yes! In fact, Docker Desktop fully supports WSL2 and works seamlessly with it. Once WSL2 is installed, you can enable the “Use WSL2-based engine” option in Docker Desktop.


Best Practices for Using WSL2

  • Keep your system updated: Both Windows and your Linux distro.

  • Use wsl –update to update the Linux kernel.

  • Regularly backup important files from your Linux environment.


WSL2 vs Virtual Machine: Which One Should You Choose?

  • Choose WSL2 if you want lightweight, fast access to Linux tools.

  • Choose a VM if you need full isolation, GPU access, or run multiple OS simultaneously.


Is WSL2 Safe for Beginners?

Absolutely! WSL2 is designed to be user-friendly and won’t mess with your main Windows setup. Think of it as installing an app, not an entire operating system.


Final Thoughts

Installing WSL2 on Windows 11 opens up a world of possibilities. Whether you’re coding, managing servers, or just curious about Linux, WSL2 gives you the best of both worlds—Linux power with Windows convenience.

The easiest way? Use:

wsl --install

But if you want more control, the manual method is just as effective.


FAQs

1. Do I need Windows 11 Pro to install WSL2?
No, WSL2 works on Windows 11 Home, Pro, and Enterprise editions.

2. How much space does WSL2 take?
The base installation is light (~200MB), but Linux distros may take additional space.

3. Can I install multiple Linux distros on WSL2?
Yes, you can install and switch between multiple distros (Ubuntu, Debian, Kali, etc.).

4. Is WSL2 better than dual booting?
For most users, yes. Dual boot offers full hardware access, but WSL2 is faster and easier.

5. Does WSL2 work without internet?
Yes, once installed. But you need an internet connection for the initial download.


Scroll to Top