Skip to main content

Command Palette

Search for a command to run...

How to Enable WSL in Linux Windows 11

Updated
7 min read

Enabling Windows Subsystem for Linux (WSL) on Windows 11 opens up a world of possibilities for developers and tech enthusiasts. If you want to run Linux distributions directly on your Windows machine without the hassle of dual booting or virtual machines, WSL is your go-to solution. In this guide, I’ll walk you through the process of enabling WSL on Windows 11, making it easy for you to start using Linux tools seamlessly.

Whether you’re new to WSL or upgrading from an older Windows version, this article covers everything you need. From the initial setup to installing your favorite Linux distribution, you’ll find clear, step-by-step instructions. Let’s dive in and get your Windows 11 ready for Linux!

What is WSL and Why Enable It on Windows 11?

WSL stands for Windows Subsystem for Linux. It’s a compatibility layer that allows you to run Linux binaries natively on Windows without the overhead of a traditional virtual machine. This means you can use Linux command-line tools, utilities, and applications directly on your Windows 11 PC.

Here’s why enabling WSL on Windows 11 is beneficial:

  • Seamless Integration: Run Linux and Windows apps side by side.
  • Developer Friendly: Use Linux tools like Bash, SSH, Git, and more.
  • Lightweight: No need for a full Linux installation or dual boot.
  • Improved Performance: WSL 2 uses a real Linux kernel for better speed.
  • Access to Linux Files: Easily access Linux files from Windows and vice versa.

Windows 11 has made enabling WSL easier than ever, with built-in commands and GUI options. It supports both WSL 1 and the more advanced WSL 2, which uses a lightweight virtual machine for full Linux kernel compatibility.

Step-by-Step Guide to Enable WSL on Windows 11

Enabling WSL on Windows 11 involves a few simple steps. You can do this using PowerShell commands or through the Windows Features GUI. Here’s how:

1. Check Your Windows Version

Before starting, make sure your Windows 11 version supports WSL 2. You need Windows 11 build 22000 or higher.

  • Press Win + R, type winver, and press Enter.
  • Confirm your build number is 22000 or above.

2. Enable WSL Using PowerShell

PowerShell is the fastest way to enable WSL and install a Linux distribution.

  • Open PowerShell as Administrator (search for PowerShell, right-click, and select “Run as administrator”).
  • Run this command to enable WSL and install the default Linux distro (usually Ubuntu):
wsl --install

This command does the following:

  • Enables the WSL feature.
  • Enables the Virtual Machine Platform.
  • Downloads and installs the latest Ubuntu Linux distribution.
  • Sets WSL 2 as the default version.

3. Restart Your Computer

After the installation completes, restart your PC to apply the changes.

4. Launch Your Linux Distribution

Once restarted:

  • Open the Start menu.
  • Search for “Ubuntu” or the Linux distribution installed.
  • Launch it and complete the initial setup by creating a username and password.

5. Verify WSL Version

To check which WSL version you’re running, open PowerShell and type:

wsl -l -v

This lists all installed Linux distributions and their WSL versions. If you want to upgrade a distro to WSL 2, use:

wsl --set-version <distro_name> 2

Replace <distro_name> with the actual name, like Ubuntu.

Alternative: Enable WSL via Windows Features GUI

If you prefer a graphical method, you can enable WSL through Windows Features.

Steps:

  • Press Win + R, type optionalfeatures.exe, and press Enter.
  • Scroll down and check Windows Subsystem for Linux.
  • Also, check Virtual Machine Platform.
  • Click OK and wait for Windows to apply the changes.
  • Restart your PC when prompted.

After reboot, install your preferred Linux distribution from the Microsoft Store.

Installing Additional Linux Distributions

Windows 11 supports many Linux distributions via the Microsoft Store. Here’s how to install more:

  • Open the Microsoft Store app.
  • Search for your preferred Linux distro (e.g., Debian, Kali Linux, openSUSE).
  • Click Get or Install.
  • Launch the distro from the Start menu and complete setup.

You can have multiple distros installed and switch between them easily.

Tips for Using WSL on Windows 11

Once WSL is enabled, here are some tips to get the most out of it:

  • Access Windows Files from Linux: Your Windows drives are mounted under /mnt/c, /mnt/d, etc.
  • Use Windows Apps from Linux: You can call Windows executables directly from the Linux terminal.
  • Update WSL Kernel: Run wsl --update in PowerShell to keep the Linux kernel up to date.
  • Set Default Distro: Use wsl --set-default <distro_name> to choose your default Linux environment.
  • Integrate with VS Code: Use the Remote - WSL extension in Visual Studio Code for seamless development.

Troubleshooting Common WSL Issues on Windows 11

Sometimes, you might face issues enabling or running WSL. Here’s how to fix common problems:

  • WSL Not Installing: Ensure virtualization is enabled in your BIOS settings.
  • Error 0x80370114: This usually means the Virtual Machine Platform is not enabled.
  • Linux Distro Won’t Launch: Try uninstalling and reinstalling the distro from the Microsoft Store.
  • Slow Performance: Make sure you’re using WSL 2, which offers better speed.
  • Update Windows: Keep your Windows 11 updated to avoid compatibility issues.

How WSL 2 Improves Your Linux Experience on Windows 11

WSL 2 is a major upgrade over WSL 1. It uses a real Linux kernel running in a lightweight virtual machine. This brings several benefits:

  • Better File System Performance: Faster read/write speeds.
  • Full System Call Compatibility: Supports more Linux apps and tools.
  • Improved Docker Support: Run Docker containers natively.
  • Automatic Kernel Updates: Microsoft regularly updates the Linux kernel.

To ensure you’re using WSL 2, run:

wsl --set-default-version 2

This sets WSL 2 as the default for all new Linux installations.

Using WSL for Development on Windows 11

WSL is perfect for developers who want to work in a Linux environment without leaving Windows. Here’s why:

  • Run Linux-native tools: Use Bash, Python, Ruby, Node.js, and more.
  • Access Windows files: Edit code in Windows editors while running Linux commands.
  • Use Docker and Kubernetes: WSL 2 supports containerized development.
  • Cross-platform Testing: Test your apps in Linux without switching machines.

Pair WSL with Visual Studio Code’s Remote - WSL extension for a smooth coding experience.

Security and Privacy Considerations with WSL

WSL runs Linux in a secure environment integrated with Windows. Here are some points to keep in mind:

  • Isolated Environment: Linux runs in a sandboxed VM, limiting risks.
  • File Access: Be cautious when sharing files between Windows and Linux.
  • Updates: Keep both Windows and WSL updated for security patches.
  • Firewall: Windows firewall applies to WSL network traffic.

WSL is designed to be safe for everyday use, but always follow best security practices.

Conclusion

Enabling WSL on Windows 11 is a straightforward process that unlocks powerful Linux capabilities on your PC. Whether you’re a developer, student, or Linux enthusiast, WSL lets you enjoy the best of both worlds without complex setups. By following the steps above, you can quickly install and start using Linux distributions right inside Windows 11.

With WSL 2’s improved performance and compatibility, your Linux experience on Windows is smoother and more efficient than ever. Remember to keep your system updated and explore the many Linux distros available. Once set up, you’ll wonder how you ever worked without it!

FAQs

How do I check if WSL is enabled on Windows 11?

Open PowerShell and run wsl -l -v. If WSL is enabled, it will list installed Linux distributions and their versions. If no distros appear, WSL might not be enabled.

Can I run graphical Linux apps with WSL on Windows 11?

Yes, Windows 11 supports GUI apps with WSLg (Windows Subsystem for Linux GUI). You can run Linux graphical apps seamlessly alongside Windows apps.

How do I switch between WSL 1 and WSL 2?

Use the command wsl --set-version <distro_name> 1 or 2 to switch a specific distro’s version. Set WSL 2 as default with wsl --set-default-version 2.

Is virtualization required to enable WSL on Windows 11?

Yes, virtualization must be enabled in your BIOS/UEFI settings for WSL 2 to work properly. WSL 1 does not require virtualization but has fewer features.

Can I install multiple Linux distributions with WSL?

Absolutely! You can install multiple distros from the Microsoft Store and run them side by side. Use wsl -l to list all installed distributions.

More from this blog

L

LinuxBloke | Linux Tips, Tricks & Troubleshooting

672 posts