Windows 11 brings a lot of new features for productivity, but one of the most powerful tools for developers is Windows Subsystem for Linux 2 (WSL2). This feature lets you run a full Linux environment inside Windows — without the need for a virtual machine or dual-boot setup.
If you’re a developer, sysadmin, or even just curious about Linux, enabling WSL2 on Windows 11 can completely change how you work. In this guide, we’ll go step by step to show you how to enable, configure, and use WSL2 like a pro.
What is WSL2?
Before we dive into the steps, let’s clarify what WSL2 actually is.
-
WSL (Windows Subsystem for Linux) is a compatibility layer that allows you to run Linux commands and applications inside Windows.
-
WSL2 is the upgraded version, using a full Linux kernel with better performance and compatibility compared to WSL1.
Think of it as having a Linux computer inside your Windows PC — without the hassle of installing Linux separately.
Why Use WSL2 on Windows 11?
Still wondering why you should enable WSL2? Here are the top benefits:
-
Run Linux and Windows together – No need for dual boot.
-
Better performance – WSL2 uses a lightweight VM for faster speeds.
-
Access Linux tools – Perfect for developers working with Python, Node.js, Docker, etc.
-
Easy file sharing – Access Windows files from Linux and vice versa.
-
Support for GUI apps – Run Linux graphical apps directly in Windows 11.
Step 1: Check Windows 11 Version Compatibility
Not all versions of Windows 11 support WSL2. You’ll need:
-
Windows 11 Home, Pro, Enterprise, or Education (64-bit).
-
Build 22000 or higher.
How to Check Your Windows Version
-
Press Windows + R.
-
Type
winverand press Enter. -
A window will show your Windows 11 version and build.
If your build is outdated, update Windows before proceeding.
Step 2: Enable WSL via Command Line
Windows 11 makes enabling WSL much simpler compared to Windows 10.
Steps
-
Open PowerShell or Windows Terminal as Administrator.
-
Type this command:
-
Press Enter and wait for the installation to complete.
This command will:
-
Enable WSL.
-
Install the Virtual Machine Platform.
-
Install the latest Linux kernel.
-
Set WSL2 as the default version.
-
Install Ubuntu by default.
Step 3: Restart Your PC
After installation, you’ll be prompted to restart your computer. Don’t skip this step — WSL2 won’t work until you reboot.
Step 4: Set WSL2 as Default (Optional)
If you already had WSL1 installed, you can switch to WSL2.
Command
This ensures any future Linux distributions you install will run on WSL2 by default.
Step 5: Install a Linux Distribution
Ubuntu is installed by default, but you can install other Linux distros from the Microsoft Store:
-
Debian
-
Kali Linux
-
openSUSE
-
Fedora Remix
How to Install Another Distro
-
Open Microsoft Store.
-
Search for your preferred Linux distribution.
-
Click Install.
Step 6: Launch Linux and Set It Up
Once installed:
-
Open the Start menu and search for Ubuntu (or your chosen distro).
-
Launch it for the first time.
-
You’ll be asked to create a username and password.
Congratulations — you’re now running Linux inside Windows!
Step 7: Update Your Linux Distro
Just like any Linux system, you should update it immediately.
For Ubuntu:
This ensures you’re working with the latest packages.
Step 8: Access Windows Files from Linux
One of the coolest features of WSL2 is file sharing.
-
In Linux, your Windows files are located under:
Example:
/mnt/c/Users/YourName/Documents
This means you can edit Windows files directly with Linux tools.
Step 9: Run Linux GUI Apps on Windows 11
Unlike WSL1, WSL2 supports Linux GUI apps natively.
Steps
-
Install a GUI app on Linux (e.g., Gedit).
-
Run it by typing:
-
The app opens in Windows with full graphical support!
Step 10: Install Additional Tools (Optional)
-
Docker Desktop with WSL2 integration – Run containers seamlessly.
-
Visual Studio Code Remote – WSL Extension – Code directly in Linux from VS Code.
-
Git – Perfect for managing repositories in Linux.
Step 11: Switch Between WSL Versions
If you want to switch a specific distro to WSL2:
Example:
Step 12: List Installed Distros
To see all Linux distributions installed on your system:
This shows which version (WSL1 or WSL2) each distro is running on.
Step 13: Uninstall or Reset WSL
If you ever want to remove a Linux distribution:
This will delete all files and reset that distro.
Step 14: Common Issues and Fixes
-
Error: WSL not recognized – Ensure you’re running PowerShell as Administrator.
-
Linux not launching – Restart PC after installation.
-
Slow performance – Allocate more resources in Windows Features → Virtual Machine Platform.
-
Networking issues – Restart WSL using:
Step 15: Best Practices for Using WSL2
-
Regularly update both Windows and Linux.
-
Use VS Code with WSL for coding efficiency.
-
Keep one distro as your main environment.
-
Avoid running too many heavy apps at once.
Advantages of WSL2 Over WSL1
-
Full Linux kernel.
-
Better performance with system calls.
-
Supports Docker and GUI apps.
-
Faster file operations.
If you’re serious about development, WSL2 is the clear winner.
Conclusion
Enabling WSL2 on Windows 11 is one of the smartest moves you can make if you want the best of both worlds: the flexibility of Linux and the convenience of Windows. With just a few commands, you can unlock a powerful development environment, run Linux apps, and even enjoy GUI applications seamlessly.
Whether you’re coding, testing, or just learning Linux, WSL2 makes it all easier. So go ahead — enable it today and supercharge your workflow.
FAQs
1. Do I need Windows 11 Pro to use WSL2?
No, WSL2 works on both Windows 11 Home and Pro editions.
2. Can I run multiple Linux distros on WSL2?
Yes! You can install Ubuntu, Debian, Kali, and more at the same time.
3. Is WSL2 better than a virtual machine?
For most tasks, yes. WSL2 is lighter and faster, but VMs may still be better for advanced networking or kernel modifications.
4. Can I access my Linux files from Windows?
Yes, you can browse Linux files directly in File Explorer by typing \\wsl$ in the address bar.
5. Does WSL2 slow down my PC?
No, it’s lightweight. Performance only depends on what apps or services you run inside Linux.
