Running Linux tools on a Windows machine used to mean dual booting or setting up a virtual machine. Both eat into disk space and slow things down. WSL — Windows Subsystem for Linux — removes that friction entirely. It runs a real Linux terminal inside Windows, no rebooting required, no separate partition needed.
What Is WSL (Windows Subsystem for Linux)?
WSL is a compatibility layer built by Microsoft that lets Windows PCs execute Linux binaries, shell scripts, and command-line programs without a virtual machine or emulator. It ships with Windows 10 (version 2004+) and Windows 11.
You can run distributions like Ubuntu, Debian, Kali, Fedora, and Arch directly from your Windows desktop. Each distro operates through its own terminal session and maintains a separate file system, though files are shared between both operating systems.
WSL 2, the current version, uses an actual Linux kernel instead of a translation layer. File system performance is noticeably faster, and compatibility with Linux programs is near-complete.
How to Install WSL on Windows
Check System Requirements
Your machine needs an x64 or ARM64 processor running Windows 10 build 19041 or later. Open System Information from the Start menu and confirm your OS build number and system type. On physical hardware, virtualization must be enabled in BIOS — the exact setting varies by manufacturer.
Enable the WSL Feature
Search for “Windows Features” in the Start menu. A dialog box lists optional components. Find “Windows Subsystem for Linux” in that list, check it, and click OK. The system will prompt a restart.
Run the Install Command
Open PowerShell as administrator and type:
wsl --install
This single command downloads the WSL components, enables the Virtual Machine Platform, and installs Ubuntu by default. On recent builds of Windows 11, it handles every prerequisite automatically — no extra steps.
Choose a Different Linux Distribution
If you’d rather use something other than Ubuntu, list what’s available:
wsl --list --online
Then install your pick with:
wsl --install -d <DistroName>
Debian, openSUSE, Kali, and Arch are all free through the Microsoft Store as well.
Set Up Your Linux Username and Password
After installation, open the distro from the Start menu. The first launch asks you to create a Unix username and password. This account is separate from your Windows login. Once you set it, you land at a Bash shell prompt, ready to go.
WSL Configuration and Useful Commands
A few commands worth knowing right away:
| Command | What It Does |
|---|---|
wsl --list --verbose | Shows installed distros and their WSL version |
wsl --set-default <Distro> | Changes your default distribution |
wsl --shutdown | Stops all running WSL instances |
wsl --update | Updates the WSL kernel to the latest build |
WSL stores its own directory tree on disk. You can access Windows files from Linux at /mnt/c/, and browse the Linux file system from Windows Explorer by typing \\wsl$ in the address bar. Operations like copying files between both systems work without any extra configuration.
Setting Up a WSL Development Environment
After the initial install, most developers update packages first. On Ubuntu or Debian, that’s:
sudo apt update && sudo apt upgrade
The apt package manager handles all software installation from here. If you run into issues with missing packages, the guide to fixing the apt-get command not found error covers the common causes.
Windows Terminal (free from the Microsoft Store) is the recommended way to manage your sessions. It supports tabs, so you can run PowerShell, Command Prompt, and multiple WSL distros side by side without opening separate windows.
VS Code integrates directly with WSL. Install it on Windows, and the Remote – WSL extension lets you edit and debug code inside the Linux file system as if it were local. No manual SSH setup required.
Common WSL Use Cases
| Use Case | How WSL Fits |
|---|---|
| Web development | Run Node.js, Python, or PHP servers locally in a Linux environment that mirrors production |
| DevOps and automation | Test shell scripts, Docker containers, and CI pipelines without leaving Windows |
| Security work | Load Kali Linux and run network scans or vulnerability assessments with native tools |
| Academic work | Practice terminal commands, file permissions, and shell scripting without dedicated hardware |
Developers who need to install specific package versions for dependency management can do so inside WSL without touching the Windows environment at all.
Tips for Getting More Out of WSL
Edit ~/.bashrc to define aliases, custom prompts, and environment variables. Small tweaks here — like shortening frequently typed paths — add up over time. The man command is available for any Linux utility you’re unfamiliar with.
WSL also lets you call Windows executables from the Linux terminal. Running explorer.exe . from a WSL session opens the current directory in Windows File Explorer. Going the other direction, you can pipe output from Linux commands into Windows programs or scripts.
For resource management, create a .wslconfig file at C:\Users\<YourUsername>\.wslconfig to cap memory usage and processor count. WSL 2 runs a lightweight VM under the hood, and these limits prevent it from consuming more than your workload actually needs.
FAQs
Is WSL free to use on Windows?
Yes. WSL is a built-in Windows feature available at no cost on Windows 10 (version 2004+) and Windows 11. Linux distributions in the Microsoft Store are also free.
Can WSL run GUI Linux applications?
WSL 2 on Windows 11 supports Linux GUI apps natively through WSLg. On Windows 10, you need a third-party X server like VcXsrv to display graphical programs.
Does WSL replace a virtual machine?
For most command-line and development tasks, yes. WSL uses fewer resources than a full VM. It does not replicate an entire Linux desktop environment, though.
Can I run Docker inside WSL?
Yes. Docker Desktop for Windows integrates with WSL 2 directly. Containers run inside the WSL backend with near-native Linux performance.
How do I uninstall a WSL distribution?
Run wsl --unregister <DistroName> in PowerShell. This removes the distro and all its data. You can reinstall it from the Microsoft Store afterward.