What Is WSL2 and How to Run Linux Inside Windows 11

tutorial
What Is WSL2 and How to Run Linux Inside Windows 11

For years, anyone who wanted to use Linux on a Windows PC faced the same awkward choice. Dual boot and reboot every time you want to switch, or run Linux inside a virtual machine that is slow, heavy, and eats your RAM. Neither option felt right for something you just want to occasionally use alongside Windows.

WSL2 is the answer to that problem. It is a feature built directly into Windows 11 that runs a real Linux environment inside a terminal window, without rebooting, without a separate app, and without touching your Windows setup. You just open a terminal and Linux is there.

What Is WSL2?

WSL2 stands for Windows Subsystem for Linux 2. It runs a genuine Linux kernel inside a lightweight virtual environment within Windows. That distinction matters because the original WSL1 worked by translating Linux commands into Windows equivalents, which caused compatibility gaps. WSL2 runs an actual Linux kernel, so software behaves exactly as it would on a native Linux machine.

From the outside it looks like a terminal window. From the inside it is a complete Linux system. You can install packages, run scripts, use git, spin up a local web server, and do anything you would do on a Linux machine, all without leaving Windows.

Microsoft made WSL fully open source in 2025 and it has become a core part of modern Windows development workflows. It is also how Docker Desktop works on Windows under the hood.

What You Need

WSL2 works on any Windows 11 PC across all editions including Home. Your processor needs to support hardware virtualization, which is enabled by default on most modern PCs. If the installation fails, that is almost always the reason and it is fixable by enabling Intel VT-x or AMD-V in your BIOS settings.

How to Install WSL2

Open PowerShell as administrator. Search for PowerShell in the Start menu, right-click it, and choose Run as administrator. Then type this and press Enter:

wsl --install

That is the entire installation. This one command enables the required Windows features, downloads the WSL2 Linux kernel, and installs Ubuntu. When it finishes, restart your PC. After restarting, Ubuntu opens automatically and asks you to create a Linux username and password. These are separate from your Windows login and only used inside Linux.

From running the command to having a working Linux terminal takes about five minutes.

Choosing a Different Linux Distribution

If you want something other than Ubuntu, first see what is available:

wsl --list --online

Then install by name:

wsl --install -d Debian

Ubuntu is the most beginner-friendly choice with the largest community. Debian is more minimal and stable. Kali Linux is aimed at security work. You can install multiple distributions and switch between them freely.

Getting Around in Linux

Open your Linux terminal any time by searching for Ubuntu in the Start menu, or by opening Windows Terminal and selecting your distribution from the dropdown.

A handful of commands is all you need to get started:

pwd shows where you are in the file system. ls lists files and folders in your current location. cd foldername moves you into a folder. cd .. moves you up one level. sudo apt update && sudo apt upgrade updates all installed packages. Run this first on a fresh installation.

Installing software works like this:

sudo apt install git sudo apt install python3 sudo apt install nodejs

Accessing Your Windows Files From Linux

Your Windows drives are automatically mounted inside WSL2. Your C: drive is at /mnt/c, so your Documents folder is at /mnt/c/Users/YourUsername/Documents.

Going the other way, you can browse your Linux files from Windows File Explorer by typing \\wsl$ in the address bar.

One important tip: if you are doing any development work, keep your project files inside the Linux filesystem rather than in your Windows folders. Accessing files through /mnt/c crosses a boundary between the two systems and is noticeably slower for projects with many files. Store active projects in ~/projects inside Linux and everything runs at full speed.

Using WSL2 With VS Code

This is one of the most practical everyday uses of WSL2. Install the Remote WSL extension from the VS Code extensions marketplace. After that, navigate to any project folder in your Linux terminal and type:

code .

VS Code opens on Windows, connected to your Linux environment. Your editor runs on Windows but the files, terminal, and tools all run inside Linux. Git, Python, Node.js, anything you installed in Linux works directly through the VS Code integrated terminal. It is a genuinely excellent setup.

What People Actually Use WSL2 For

Web developers run local development servers with the same Linux stack their production servers use, which eliminates the classic problem of something working on the server but not on the development machine.

Backend developers run Linux-native tools, build systems, and package managers that are poorly supported or unavailable on Windows.

Students and curious users learn Linux commands and get comfortable with a terminal without needing a second machine.

Data scientists run Python, TensorFlow, PyTorch, and other AI and ML frameworks in a Linux environment where most of those tools are primarily built and tested.

If you use Docker Desktop on Windows, you are already using WSL2 as its backend whether you knew it or not.

WSL2 vs Dual Boot vs Virtual Machine

WSL2Virtual MachineDual Boot
Reboot to switchNoNoYes
Heavy on RAMNoYesNo
Full Linux compatibilityYesYesYes
Access Windows files from LinuxYesLimitedLimited
Setup difficultyVery easyModerateModerate
CostFree, built into Windows 11Free with VirtualBoxFree

Final Thoughts

WSL2 is one of the most genuinely useful things Microsoft has added to Windows in years. One command, a restart, and you have a full Linux environment running alongside Windows 11. No second machine, no rebooting, no sluggish virtual machine. If you have ever been curious about Linux or needed it for development work, there has never been a lower-friction way to get started.

Frequently Asked Questions

Is WSL2 free?

Yes. It is a built-in feature of Windows 11 across all editions. No purchase or subscription required. Run wsl --install in an administrator PowerShell window and you are done.

Does WSL2 slow down Windows while it is running?

No. WSL2 only uses resources when you are actively using it. When the terminal is closed it uses virtually no CPU and minimal memory. It does not sit in the background consuming resources unless you have Linux services actively running.

Can I run graphical Linux apps with WSL2?

Yes. Windows 11 includes WSLg, which lets graphical Linux applications run as normal windows on your desktop, integrated with your taskbar and Alt-Tab switcher. No extra setup is needed beyond installing the apps themselves.

What is the difference between WSL1 and WSL2?

WSL1 translated Linux system calls into Windows equivalents, which caused compatibility problems with some software. WSL2 runs a real Linux kernel inside a lightweight virtual machine, giving you full Linux compatibility and much better performance for most workloads.

Can I install multiple Linux distributions at the same time?

Yes. Install as many as you like and switch between them freely. Run wsl --list to see everything installed and wsl -d DistributionName to launch a specific one.

Discover: Uncategorized

Discussion (0)

Be the first to comment.