WSL (Windows Subsystem for Linux) allows running a full Linux environment natively on Windows — no virtual machine overhead, no dual boot. WSL2 replaced the original syscall-translation layer of WSL1 with a genuine Linux kernel inside a lightweight Hyper-V Micro-VM, gaining full system call compatibility, systemd support, Docker, GPU compute, and 2–20× faster native Linux file I/O. The single most important practical tip: always keep project files inside the WSL file system (not under /mnt/c) — cross-filesystem access through the OS boundary carries a severe performance penalty that WSL1 users rarely hit. Since May 2025 the WSL source code is open on GitHub, and WSL ships updates through the Microsoft Store independently of Windows OS releases.
What This Cheat Sheet Covers
This topic spans 14 focused tables and 116 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: WSL1 vs WSL2 Architecture
The core architectural split: WSL1 translates Linux syscalls into Windows NT calls with no real kernel, while WSL2 runs a genuine Linux kernel in a Hyper-V Micro-VM. This single difference explains nearly every feature and performance difference between the two versions.
| Type | Example | Description |
|---|---|---|
wsl --set-version Ubuntu 1 | Translates Linux syscalls to Windows NT calls via a compatibility layer; no real Linux kernel, lower startup overhead, faster cross-OS file access | |
wsl --set-version Ubuntu 2 | Runs a full Linux kernel in a lightweight managed VM; full syscall compatibility, faster native Linux I/O, supports Docker and systemd | |
Docker, snap, eBPF in WSL2 | WSL2 supports 100% of Linux syscalls; WSL1 covers only a translation subset — some apps (Docker, snap) simply won't run on WSL1 | |
npm install in ~/project vs /mnt/c/project | WSL2 is 2–20× faster for file-intensive operations when files live in the Linux VHD; WSL1 is faster for accessing files on the Windows FS (/mnt/c) |