My Windows development environment guide covers the Windows side: Windows Terminal, winget and the editor. This post goes deeper into the part that does the real work, the Linux layer. A well-tuned WSL2 development environment gets you a genuine Linux kernel on a Windows laptop with almost none of the old virtual machine friction, but the defaults leave performance on the table.
Install WSL and pick a distro
On Windows 11, or Windows 10 version 2004 and later, open PowerShell as administrator:
wsl --install
That enables the required features and installs Ubuntu. Reboot, launch it, and create your Linux username and password. To see other options and install a different distribution:
wsl --list --online
wsl --install -d <DistroName>
wsl --list --verbose
wsl --update
New installs default to WSL 2. If wsl -l -v shows an old distro on version 1, convert it with wsl --set-version <Distro> 2. Ubuntu is the safe choice, and everything in my Ubuntu development environment guide applies inside it. If you prefer Fedora or Arch, check the online list and then follow the Fedora or Arch guides inside WSL.
Turn on systemd
Recent WSL releases support systemd, which you want for services like Docker Engine, PostgreSQL or anything with a unit file. Edit /etc/wsl.conf inside the distro:
[boot]
systemd=true
Then run wsl --shutdown from PowerShell and start the distro again. Current Ubuntu images often have this enabled already, so check first.
Tune the VM with .wslconfig
Global settings live in %UserProfile%\.wslconfig on the Windows side. By default WSL can take up to half your RAM, which hurts on a 16GB laptop running a browser and Teams. My starting point:
[wsl2]
memory=8GB
processors=6
networkingMode=mirrored
[experimental]
autoMemoryReclaim=gradual
sparseVhd=true
memoryandprocessorscap the VM so Windows stays responsive.networkingMode=mirrored(Windows 11 22H2 or later) shares Windows’ network interfaces with Linux, which fixes many VPN problems and makes localhost behave the way you’d expect in both directions.autoMemoryReclaimhands cached memory back to Windows instead of hoarding it.sparseVhdlets newly created virtual disks shrink when you delete files.
Run wsl --shutdown after changes. Microsoft now recommends the WSL Settings app in the Start menu for editing these, and it writes the same file.
The rule that matters most: keep code in Linux
Windows drives are mounted under /mnt/c, but file access across that boundary is slow. Running npm install or composer install on a project in /mnt/c/Users/... can be many times slower than in your Linux home directory. Clone everything to ~/code inside WSL. You can still browse it from Explorer at \\wsl.localhost\<Distro>, or run explorer.exe . from the terminal.
Git, shell and runtimes
Inside the distro, set things up exactly as you would on native Linux:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
ssh-keygen -t ed25519 -C "you@example.com"
gh auth login
curl -fsSL https://mise.run | sh
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc
exec zsh
mise use --global node@24
mise use --global python@3
Use Git inside WSL for repos that live in WSL. Mixing Windows Git and Linux Git on the same checkout causes line-ending and file-permission noise. Set git config --global core.autocrlf input in WSL if you collaborate with Windows-native users.
Docker: Desktop or Engine
You have two good options. Docker Desktop for Windows uses a WSL2 backend; enable integration for your distro in its settings and the docker command just works inside WSL. Check its licence terms if you’re at a larger company. Alternatively, with systemd enabled, install Docker Engine directly inside the distro using Docker’s official instructions for that distro. It’s lighter and free, but you lose the GUI.
Editor: VS Code with the WSL extension
Install VS Code on Windows, add the WSL extension, then from your project folder in the Linux terminal run code .. VS Code runs its UI on Windows and a server inside Linux, so extensions, terminals and debuggers all run in WSL against fast Linux file paths. This is the single biggest quality-of-life win in the whole setup.
AI coding tools
Install Claude Code inside WSL rather than on Windows, so it sees the same file system, Git and toolchain your code does:
curl -fsSL https://claude.ai/install.sh | bash
claude --version
claude doctor
Wrapping up
With a capped, mirrored-network VM, systemd, code in the Linux file system and VS Code’s WSL extension, a WSL2 development environment feels like a native Linux machine that also happens to run Windows apps. To keep your shell config identical between WSL and every other machine, see how to manage your dotfiles with chezmoi.

Leave a Reply
You must be logged in to post a comment.