Why Switching Sucks for Developers

Modern development often demands both Linux and Windows. Linux is the natural habitat for tools like Bash, Git, Docker, and servers. But Windows still rules for desktop apps, design tools, and productivity software.

Until recently, working across both meant dual-booting, remote SSH, or heavy virtual machines, all of which hurt focus and performance.

Meet WSL: Your One Environment

Windows Subsystem for Linux (WSL) solves this. It runs a real Linux environment inside Windows, without needing to reboot or fire up a VM manually.

There are two major versions:

WSL 1

  • Translates Linux syscalls to Windows equivalents
  • Lightweight and fast startup
  • Great for basic CLI tools

WSL 2

  • Runs an actual Linux kernel in a managed lightweight VM (using Hyper-V)
  • Provides full syscall compatibility
  • Supports Docker, inotify, and other advanced Linux features

WSL 2 is the current default and recommended version for most developers.


How WSL 2 Works Internally

When you install WSL 2:

  • A lightweight VM is spun up using Hyper-V
  • It hosts a real Linux kernel maintained by Microsoft
  • That kernel boots in milliseconds and runs distros like Ubuntu, Debian, Fedora, etc.
  • Your filesystem is virtualized and accessible from both Windows and Linux
  • Network and ports are shared between environments

Key pieces:

  • VHDX Disk: Each distro gets a virtual disk file for storing Linux files
  • Interop Layer: Lets you call Windows programs from Linux and vice versa
  • 9P Protocol: Used to share filesystems efficiently between Linux and Windows

Shared Environment

  • Linux can access Windows files at /mnt/c/Users/...
  • Windows can access Linux via \\wsl.localhost\Ubuntu\home\user
  • They share the same network stack (localhost), so ports are accessible from both sides

Configuration & Resource Tuning

WSL 2 dynamically adjusts resources, but you can configure it manually for better control:

Create %UserProfile%\.wslconfig and add:

[wsl2]
memory=4GB
processors=2
swap=1GB
localhostForwarding=true

This limits memory to 4 GB, uses 2 cores, and adds swap space.

To control mount behavior and improve file I/O, add /etc/wsl.conf inside your distro:

[automount]
options = "metadata,umask=22,fmask=11"

This improves permission handling and speeds up file operations.


Minimal Setup Commands

To install and get started:

wsl --install

This installs Ubuntu by default. To list and switch distributions:

wsl --list --verbose
wsl --set-version Ubuntu 2

To install tools inside WSL:

sudo apt update && sudo apt install git build-essential

Use Cases That Shine with WSL

  • Web development: use Node, Python, Ruby natively
  • Docker containers: native support with Docker Desktop
  • Cloud tools: AWS CLI, Terraform, Ansible, all in Linux
  • Scripting and automation: Bash + cron + GNU tools

Conclusion: All You Need in One OS

WSL 2 blends Linux’s power with Windows’ accessibility. It keeps your workflows local, your tools integrated, and your performance strong. No more jumping between machines or managing complex VMs.

Just one command to install. After that, you’re home.

wsl --install

Try it, tune it, and never look back.