What Is WSL2 and Why Should You Care?

WSL stands for Windows Subsystem for Linux. Version 2 (WSL2) runs a genuine Linux kernel inside a lightweight virtual machine on your Windows computer. That means you get a real, fully functional Linux terminal — with access to tools like bash, grep, git, Python, Node.js, and more — without dual-booting or erasing Windows.

It's ideal for developers, students learning Linux, or anyone who needs Unix-style tools for scripting, web development, or system administration.

Requirements

  • Windows 10 (version 2004 or later) or Windows 11
  • A 64-bit processor with virtualization enabled in BIOS
  • At least 4GB RAM (8GB+ recommended)

Step 1: Enable WSL via PowerShell

Open PowerShell as Administrator (right-click the Start menu → Windows PowerShell (Admin)) and run the following command:

wsl --install

This single command does everything: enables the WSL feature, installs WSL2, and downloads Ubuntu (the default Linux distribution) from the Microsoft Store. Your PC will need to restart after this step.

Step 2: Set WSL2 as the Default Version

After restarting, open PowerShell again and confirm WSL2 is your default:

wsl --set-default-version 2

You can also check which version is running for any installed distro:

wsl --list --verbose

Step 3: Complete the Linux Setup

After your PC restarts, Ubuntu will launch automatically and ask you to create a Linux username and password. These are separate from your Windows credentials — choose something easy to remember. This user account will be your default Linux user.

Step 4: Update Your Linux Packages

Once you're inside the Linux terminal, run the standard Ubuntu update commands to make sure everything is current:

sudo apt update && sudo apt upgrade -y

Enter your Linux password when prompted. This fetches and installs the latest package versions.

Step 5: Install a Different Linux Distro (Optional)

Don't want Ubuntu? WSL supports multiple distributions. See what's available:

wsl --list --online

Install a specific distro like Debian or Kali:

wsl --install -d Debian

You can have multiple Linux distributions installed side by side.

Step 6: Use VS Code with WSL (Recommended)

If you use Visual Studio Code, install the WSL extension from the Extensions marketplace. Then, from inside your Linux terminal, navigate to your project folder and run:

code .

VS Code will open on the Windows side but connect to your Linux filesystem — giving you the best of both worlds for development.

Useful WSL Tips

  • Access Windows files from Linux: Your Windows drives are mounted at /mnt/c/, /mnt/d/, etc.
  • Access Linux files from Windows: In File Explorer, look for the Linux icon in the left sidebar, or type \\wsl$ in the address bar.
  • Shut down WSL: Run wsl --shutdown in PowerShell to stop all running Linux instances.
  • Set a default distro: wsl --set-default Ubuntu

You're Ready to Go

WSL2 is one of the most developer-friendly features Microsoft has ever shipped. Whether you're learning Linux commands, running Python scripts, managing Docker containers, or building web apps, you now have a full Linux environment living comfortably inside Windows. No virtual machine headaches, no dual-boot confusion — just a terminal and your curiosity.