WSL 2 File Performance: Why Your Project Location Matters More Than You Think
WSL 2's 9P bridge makes /mnt/c 8-10x slower than the Linux ext4 VHDX. Benchmark it, move your projects to ~/projects, and keep GPU drivers in sync for real-world speed.
09 Feb 2026, 01:44 UTC

The problem: cross-OS file access kills build times
You clone a repository to /mnt/c/Users/you/project, run npm install or cargo build, and watch the terminal crawl. The same command inside ~/project finishes in seconds. The difference isn't CPU or RAM—it's the 9P protocol bridge between the Windows host and the WSL 2 virtual machine. Understanding where your files live is the single biggest performance lever in WSL 2.
WSL 2 architecture in 30 seconds
WSL 2 runs a real Linux kernel inside a lightweight utility VM (Virtual Machine Platform, a subset of Hyper-V). The VM boots in under a second, shares memory with the host, and exposes a virtual network switch. Your Linux distribution's root filesystem lives in a VHDX formatted as ext4. That ext4 volume is inside the VM, so Linux syscalls hit native inode structures.
When you access /mnt/c, the request travels over the 9P file-server protocol to the Windows host, which then services it through NTFS. Every open(), read(), stat() crosses that boundary. Metadata-heavy workloads (git status, node_modules, cargo target directories) amplify the overhead because each file triggers multiple round-trips.
Measuring the gap: a concrete benchmark
Run this inside your WSL distribution (Ubuntu, Debian, etc.) to see the difference on your hardware. Requires dd and ~1 GB free space.
# Linux-side (ext4 in VHDX)
dd if=/dev/zero of=~/test-write bs=1M count=1024 conv=fdatasync
# Windows-side via 9P (/mnt/c must exist)
dd if=/dev/zero of=/mnt/c/temp/test-write bs=1M count=1024 conv=fdatasync
Typical results on a modern NVMe SSD (Windows 11 23H2, WSL kernel 6.6.x):
| Location | Write throughput | Read throughput (cached) |
|---|---|---|
~/test-write (ext4) | 2.8–3.2 GB/s | 6–8 GB/s |
/mnt/c/temp/test-write (9P) | 180–350 MB/s | 400–700 MB/s |
The 9P path is 8–10× slower for sequential writes. Random I/O (git, npm, cargo) widens the gap further because each syscall incurs protocol overhead. Clean up with rm ~/test-write /mnt/c/temp/test-write.
GPU compute works—but keep the driver match tight
WSL 2 exposes the host GPU through DX12/Vulkan user-mode drivers mapped into the VM. NVIDIA, AMD, and Intel all support this. The catch: the user-mode driver version inside WSL must match the host driver. Windows Update delivers the Linux kernel; GPU drivers come from the vendor. If you update the host driver but the WSL kernel hasn't pulled the matching user-mode component, nvidia-smi may crash or fall back to software rendering.
Verification steps (run in PowerShell and inside WSL):
# Host
nvidia-smi # or dxdiag for driver version
# Inside WSL
nvidia-smi
vulkaninfo | grep 'deviceName\|driverVersion'
If versions diverge, reinstall the GPU driver on the host (clean install option) and run wsl --shutdown to force the VM to reinitialize the driver mapping.
Trade-offs you'll hit in practice
- Hypervisor conflicts: VMware Workstation 17+ and VirtualBox 7+ support Hyper-V paravirtualization, but older versions require disabling Virtual Machine Platform.
bcdedit /set hypervisorlaunchtype offdisables WSL 2 entirely. - Networking defaults to NAT:
localhostport forwarding works for most dev servers. VPNs, multicast, or inbound connections from LAN need.wslconfigtweaks or mirrored mode (Windows 11 22H2+). - Clock drift after sleep: The VM clock can desync. Add
[boot]\ncommand = "hwclock -s"to/etc/wsl.confor runwsl --shutdownafter resume.
Actionable checklist for a faster WSL 2 workflow
- Store project files in the Linux root (
~/projects,/workspace)—not under/mnt/c. - Use
git,npm,cargo,goinside WSL; only edit with Windows tools (VS Code Remote-WSL) if needed. - Run the
ddbenchmark once to confirm your disk topology behaves as expected. - Pin GPU driver versions: update host driver →
wsl --shutdown→ verifynvidia-smiinside WSL. - Enable
clocksyncin/etc/wsl.confif you suspend/resume frequently.
WSL 2 gives you a genuine Linux kernel with Windows convenience. The performance ceiling is high—if you keep the hot path on the ext4 VHDX and treat /mnt/c as cold storage.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.