WSL1 was a hack - it tried to translate Linux system calls to Windows and mostly failed. WSL2 just runs real Linux in a VM. Simple concept, way better execution.
Real Linux, Real Performance
The biggest difference is that WSL2 runs an actual Linux kernel instead of pretending to be Linux. Microsoft builds their own kernel from Linux sources, which sounds sketchy but actually works well. Everything that runs on regular Linux runs on WSL2 - no more "this tool doesn't work because WSL1 doesn't support X syscall."
In my testing, it's about 90-95% of native Linux performance for most dev work. File operations between Windows and Linux are slower due to the translation layer, but anything within the Linux filesystem is basically native speed. I've seen NPM installs go from 45 seconds on Windows to 8 seconds in WSL2 just by moving the project to /home/username
.
The VM That Doesn't Suck
WSL2 runs in a lightweight VM that boots in under 2 seconds and goes to sleep when you're not using it. None of the pre-allocation bullshit that VirtualBox or VMware makes you deal with. It starts around 200MB RAM and can eat 50% of your system memory if you let it (there's a config for that).
Key things that make it work:
- Instant startup: No waiting for a VM to boot
- Dynamic memory: Takes what it needs, gives back what it doesn't (eventually)
- File sharing: Access Windows files from Linux and vice versa
- systemd support: Finally works properly as of 2022
File System Reality Check
You can access Windows files from Linux at `/mnt/c` and Linux files from Windows at `\\wsl$`. Sounds great in theory, has gotchas in practice.
The Golden Rule: Keep your code in the Linux filesystem (/home/username
), not on the Windows side. Cross-filesystem operations are slow enough to be annoying. If you keep a React project on your Windows desktop and run npm start
from WSL2, file watching barely works and hot reload takes forever.
What actually works well:
- Linux tools operating on Linux files: Fast
- Windows editors (VS Code) editing Linux files via WSL extension: Fast
- Linux tools operating on Windows files: Slow but functional
- Windows tools operating on Linux files: Usually works, sometimes doesn't
The performance difference is real - I've measured 5-10x slower build times when projects live on the Windows filesystem versus the Linux filesystem. Microsoft acknowledges this limitation in their docs.