How the WSL2 filesystem works and where to put your code
Linux filesystem root, /mnt/c mount point, WSL home directory, filesystem performance difference, \\wsl$ UNC path, where to store projects
WSL2 Filesystem Layout
WSL2 gives you two separate filesystems. Understanding which one to use prevents the most common performance pitfall beginners hit.
The Linux filesystem
Your Linux home directory lives at ~, which maps to a virtual disk image on your Windows drive. File operations here run at full Linux speed because the kernel handles them directly.
The Windows mount at /mnt/c
Your entire C: drive is accessible inside WSL2 at /mnt/c. You can read and write Windows files, but every operation crosses the VM boundary — expect 3-5x slower I/O for intensive tasks like installing npm packages or compiling large projects.
Accessing Linux files from Windows
Open Windows Explorer and navigate to \\wsl$\Ubuntu (or whatever distro you installed). You can drag files in, but this is the slow path for bulk operations.
The rule
# Good — fast Linux FS
cd ~
mkdir projects
# Slow — Windows FS accessed through WSL
cd /mnt/c/Users/yourname/Documents/projectsClone repos, run npm install, and compile inside ~/projects. Only open files in Windows apps (like VS Code) when you need to edit them.
