Guides/Windows
Windows8 min read

How to Set Up WSL2 on Windows 10 and 11 (Full Guide)

WSL2 (Windows Subsystem for Linux 2) lets you run a real Linux kernel on Windows. This guide covers installation, setting the default version, installing Ubuntu, configuring VS Code integration, and performance tips.

Enable WSL2 in One Command

Open PowerShell as Administrator and run: wsl --install. This single command enables the WSL feature, installs the Linux kernel, sets WSL2 as default, and installs Ubuntu. Restart when prompted. On older Windows 10 builds (pre-2004) you need to enable the Virtual Machine Platform feature separately first.

Install a Specific Linux Distribution

Run wsl --list --online to see available distributions. Install any with: wsl --install -d Debian (or Kali, openSUSE, etc.). After installation, launch it from the Start menu or by typing the distro name in PowerShell. The first launch asks you to create a UNIX username and password — this is separate from your Windows account.

Set WSL2 as Default for All Distros

Run: wsl --set-default-version 2. To convert an existing WSL1 distro: wsl --set-version Ubuntu 2. Verify with: wsl --list --verbose. WSL2 uses a real Linux kernel in a lightweight VM, giving full system call compatibility unlike WSL1. This is critical for tools like Docker, which require WSL2.

Integrate WSL2 with VS Code

Install the "WSL" extension in VS Code. Then inside your WSL terminal, navigate to any project folder and type: code . — VS Code opens on Windows but all file operations, terminal commands, and extensions run inside Linux. This gives you full Linux tooling (gcc, make, Python, Node) with a native Windows editor experience.

Configure WSL2 Memory and CPU Limits

By default WSL2 can use 50% of your RAM and all CPU cores. To limit this, create a file at C:\Users\YourName\.wslconfig with: [wsl2] memory=4GB processors=2. Run wsl --shutdown in PowerShell, then relaunch. This prevents WSL2 from consuming all your RAM when running builds or tests.

Access Windows Files from Linux (and Vice Versa)

Your Windows C: drive is mounted at /mnt/c inside WSL2. Access files with: ls /mnt/c/Users/YourName. From Windows Explorer, type \\wsl$ in the address bar to browse your Linux filesystem. For best performance, store project files inside the Linux filesystem (~/ ) rather than on /mnt/c — cross-filesystem I/O is significantly slower.

Need Help?

Want this done for you?

Our engineering team handles implementations like this every week. Get a free scoping call — we will tell you exactly what it takes and what it costs.

Book a free call

© 2026 NexWorldTech — Built for Global Dominance.