TL;DR — WSL lets you run a real Linux userland—including CLI tools, services, GUI apps, Docker, and CUDA/DirectML ML workloads—directly on Windows without a traditional VM. It first appeared in Windows 10 Anniversary Update (1607) in 2016 (WSL 1) and was upgraded to WSL 2 with a real Linux kernel in Windows 10 version 2004. Today WSL is delivered via the Microsoft Store (faster updates) and is open source.

What exactly is WSL?

Windows Subsystem for Linux (WSL) enables a GNU/Linux environment—shell, binaries, services, GUI apps—to run on Windows, unmodified. WSL 1 translated Linux syscalls; WSL 2 uses a real Linux kernel, vastly improving compatibility and enabling features like Docker and GPU acceleration.

A quick timeline

  • 2016 – WSL 1 arrives with Windows 10 Anniversary Update (1607), originally "Bash on Ubuntu on Windows."
  • 2020 – WSL 2 GA with Windows 10 version 2004 (May 2020 Update).
  • 2021+ – Store-delivered WSL and the single-command installer wsl --install.
  • 2025 – WSL goes open source and continues to ship independently of Windows.

Install WSL (the fast way)

wsl --install

This command enables the required features and installs the default distribution (Ubuntu). To view other distributions:

wsl --list --online
wsl --install -d <DistroName>

Verify that WSL is installed and configured

wsl --version
wsl --status
wsl -l -v

Convert or set defaults:

wsl --set-default-version 2
wsl --set-version <DistroName> 2

Pick and manage Linux distributions

wsl --list --online
wsl --install -d <Name>
wsl --set-default <DistroName>
wsl --export <DistroName> Distro.tar
wsl --import <NewName> C:\WSL\ Distro.tar --version 2

Filesystems & cross-OS access

  • Linux → Windows: access /mnt/<drive>, mount DrvFS, launch Windows apps.
  • Windows → Linux: File Explorer path \\wsl$\Distro\.

Run Linux GUI apps on Windows

WSL (with WSLg) supports graphical apps with native integration—start menu, taskbar, Alt-Tab, clipboard. Works on Windows 11 or Windows 10 Build 19044+.

Networking that "just works" — and mirrored mode

  • Access Linux servers at http://localhost:<port> from Windows browsers.
  • Enable mirrored mode for IPv6 and consistent localhost mapping:
[wsl2]
networkingMode = mirrored

GPU acceleration for ML and data science

WSL 2 can access your GPU via NVIDIA CUDA or DirectML (AMD, Intel, NVIDIA) for TensorFlow/PyTorch workloads.

Docker Desktop + WSL

Enable the WSL 2 backend in Docker Desktop to run Linux containers natively. For best performance, keep project files inside the Linux filesystem.

VS Code integration

code --install-extension ms-vscode-remote.remote-wsl

Use the Remote – WSL extension to develop and debug directly in your distro.

Field-tested workflows you can adopt today

  • Cross-OS files: cd /mnt/c inside WSL; open \\wsl.localhost\ from Windows; launch Explorer via powershell.exe /c start .
  • GUI apps: run gedit, xcalc, nautilus, vlc, firefox—they integrate with the Start menu.
  • GPU in action: monitor GPU usage in Task Manager while training models in WSL.
  • Networking: start a Node app on port 3000 and browse to http://localhost:3000 from Windows.
  • Distro management: wsl -l -o, wsl --install <Distro>, wsl -l.
  • Docker & VS Code: combine Docker Desktop (WSL 2 backend) with VS Code Remote – WSL for a Linux-native dev loop.

Common gotchas (and how to avoid them)

  1. Slow I/O on /mnt/c: keep repos in the Linux filesystem.
  2. Cannot reach Windows localhost: enable mirrored mode or use Windows host IP.
  3. High Vmmem usage: cap memory/CPU in .wslconfig and restart WSL.
  4. Accessing ext4 disks: use wsl --mount (admin) to attach external/ext4 drives.

Copy-paste cheatsheet

# Install and list
wsl --install
wsl -l -o
wsl -l -v

# Choose versions / defaults
wsl --set-default-version 2
wsl --set-version Ubuntu-24.04 2
wsl --set-default Ubuntu-24.04

# Export/Import/Unregister
wsl --export Ubuntu-24.04 Ubuntu2404.tar
wsl --import Ubuntu-Dev C:\WSL\ Ubuntu2404.tar --version 2
wsl --unregister Ubuntu-Old

# Restart WSL after config changes
wsl --shutdown
# %UserProfile%\.wslconfig
[wsl2]
memory      = 8GB
processors  = 4
networkingMode = mirrored
💡 Key Takeaways:
  • Use wsl --install for quick setup
  • Keep project files in Linux filesystem for best performance
  • Enable mirrored networking for better localhost access
  • Use WSLg for GUI applications with native Windows integration
  • Combine with Docker Desktop and VS Code for a complete development environment

Further reading & official docs

❓ Frequently Asked Questions

What is the difference between WSL 1 and WSL 2?

WSL 2 uses a real Linux kernel running in a lightweight VM, providing full system call compatibility and better performance. WSL 1 translates Linux system calls to Windows equivalents, which is faster for cross-OS file operations but lacks full compatibility.

Should I store my projects in Windows or Linux filesystem?

Store projects in the Linux filesystem (/home/user/) for best performance with WSL 2. Cross-filesystem operations between Windows and Linux are significantly slower, especially for Node.js projects with many small files.

How do I access Windows files from WSL?

Windows drives are mounted at /mnt/c, /mnt/d, etc. You can access C:\Users\YourName from WSL at /mnt/c/Users/YourName. Use Windows paths sparingly for better performance.

Why can't I access my WSL web server from Windows?

Enable mirrored networking in .wslconfig by setting networkingMode=mirrored. This allows localhost on Windows to reach services running in WSL. Alternatively, use the WSL IP address found with hostname -I.

How do I run GUI applications in WSL?

WSL 2 includes WSLg (WSL GUI) support for running Linux GUI applications. Simply install the app (like code, firefox) and run it - the GUI will appear on Windows automatically.