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

Want to run Linux on your Windows 11 PC without using a separate computer or virtual machine? Enter WSL (Windows Subsystem for Linux)—Microsoft’s magic tool that lets you run a full-fledged Linux environment right inside Windows. If you’re into coding, web development, or just exploring Linux, this is a game-changer.

In this guide, I’ll walk you through everything you need to know about installing WSL on Windows 11, step by step, without the tech jargon.


What is WSL and Why Should You Use It?

A Quick Introduction to WSL

WSL is a compatibility layer created by Microsoft that allows you to run Linux distributions directly on Windows—no dual boot, no virtual machine.

Benefits of WSL

  • Seamless Integration: Access Linux tools from Windows.

  • Lightweight: Unlike virtual machines, WSL uses fewer resources.

  • Perfect for Developers: Ideal for Python, Node.js, and web development workflows.

  • No Reboot Needed: Run Linux alongside Windows instantly.


What You’ll Need Before Installing WSL

1. A Windows 11 PC

Ensure you’re running Windows 11 (Home, Pro, or Enterprise).

2. Administrator Access

You’ll need admin rights to install and configure WSL.

3. Internet Connection

A stable connection is required to download Linux distributions.


Step 1: Enable Windows Subsystem for Linux

Using Command Prompt (Recommended)

  1. Search for Command Prompt or PowerShell, right-click, and select Run as administrator.

  2. Type the following command and hit Enter:

    wsl --install

    This command will automatically enable WSL and install the default Linux distribution (usually Ubuntu).

Using Optional Features (Manual Method)

If you want more control:

  1. Open Settings > Apps > Optional features.

  2. Click More Windows features.

  3. Check Windows Subsystem for Linux and click OK.

  4. Restart your PC.


Step 2: Install a Linux Distribution

Default Linux Distribution

By default, wsl --install installs Ubuntu, but you can choose others like Debian, Kali Linux, or Fedora.

Manually Selecting a Distro

  1. Open Microsoft Store.

  2. Search for your preferred Linux distribution.

  3. Click Get and install it.


Step 3: Set WSL Version (WSL 1 vs WSL 2)

Why WSL 2?

WSL 2 is faster, supports full system calls, and offers better performance.

How to Set WSL 2 as Default

Open Command Prompt (admin) and run:

wsl --set-default-version 2

Check Your WSL Version

Run:

wsl --list --verbose

Step 4: Launch Your Linux Environment

Once installed, launch your Linux distribution from the Start Menu.

  • The first launch will take a few minutes.

  • Set your username and password.

  • Congratulations, you’re officially running Linux on Windows!


Step 5: Update Your Linux Packages

Run these commands to keep your system up to date:

sudo apt update
sudo apt upgrade

This ensures you have the latest security patches and tools.


How to Access Linux Files from Windows

  • Open File Explorer and type:

    \\wsl$
  • This gives you direct access to your Linux file system.


How to Access Windows Files from Linux

Your Windows files are mounted automatically. Just go to:

/mnt/c/

Here, you’ll find your C: drive, and so on.


Bonus: Installing Additional Tools

Install Git

sudo apt install git

Install Python

sudo apt install python3 python3-pip

Install Node.js

sudo apt install nodejs npm

Troubleshooting Common WSL Issues

1. WSL Command Not Found

Make sure you’ve enabled WSL in Windows Features.

2. Linux Distro Won’t Launch

Try restarting your PC and running:

wsl --shutdown

Then relaunch.

3. WSL 2 Not Working

Ensure Virtual Machine Platform is enabled in Windows Features.


Advantages of WSL Over Dual Boot or VM

  • No need to partition your disk.

  • Runs side-by-side with Windows.

  • Faster startup and lower resource usage.


Should You Use WSL for Development?

Absolutely! It’s a favorite among developers for:

  • Web development

  • AI & machine learning

  • Bash scripting

  • Docker integration


Conclusion

Installing WSL on Windows 11 opens up a whole new world of possibilities. Whether you’re a developer looking to streamline your workflow or just curious about Linux, WSL is the perfect bridge between two powerful ecosystems. With the steps above, you can set it up in just a few minutes and start exploring right away.


FAQs

1. Is WSL free to use?

Yes! WSL and most Linux distributions are free.

2. Can I install multiple Linux distributions on WSL?

Absolutely! You can install Ubuntu, Debian, Kali, and more at the same time.

3. Does WSL support GUI applications?

Yes, WSL 2 supports running Linux GUI apps on Windows 11.

4. Can I uninstall WSL if I don’t need it?

Yes, you can remove it through Apps & Features or by running:

wsl --unregister <DistroName>

5. Do I need WSL 2, or is WSL 1 enough?

WSL 2 is recommended for better compatibility and performance.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top