Running WSL (Windows Subsystem for Linux) means launching a Linux environment directly on Windows without a virtual machine or dual boot. Once installed, you can start it from the Start menu, a terminal, or by typing wsl in Command Prompt or PowerShell. This guide walks through the full process: checking prerequisites, installing WSL, launching your first distribution, and fixing the problems that most often stop people cold.
What You'll Need
- Windows 10 version 2004 (build 19041) or later, or Windows 11. Older builds need manual enablement steps.
- Administrator access to the PC for the one-time installation.
- Virtualization enabled in BIOS/UEFI (required for WSL 2). Most modern PCs have it on by default, but it is worth checking.
- An internet connection for downloading the Linux distribution.
- Roughly 1–2 GB of free disk space for a typical distribution, more if you install large toolchains.
Step-by-Step
- Open PowerShell as Administrator. Right-click the Start button and choose “Windows PowerShell (Admin)” or “Terminal (Admin)” on Windows 11. The installation step needs elevated rights.
- Install WSL with one command. Type
wsl --installand press Enter. This enables the required Windows features (Virtual Machine Platform and the WSL optional component), downloads the latest WSL kernel, sets WSL 2 as the default, and installs Ubuntu. Wait for it to finish. - Restart the computer. A reboot is required for the Windows features to take effect. Save your work first.
- Let Ubuntu finish setting up. After the restart, Ubuntu may open automatically. If it does not, launch “Ubuntu” from the Start menu. A console window appears and asks you to create a UNIX username and password. The password does not echo as you type — that is normal.
- Verify the installation. Open PowerShell and run
wsl --list --verbose(orwsl -l -v). You should see your distribution listed with version 2. If it shows version 1, runwsl --set-version Ubuntu 2. - Launch WSL whenever you need it. From the Start menu, click your distribution’s icon. From any terminal, type
wslto enter the default distribution, orwsl -d Ubuntuto target a specific one. To run a single command without entering the shell, usewsl ls -laor similar. - Update the Linux packages. Inside the WSL shell, run
sudo apt update && sudo apt upgrade -y(for Ubuntu/Debian). This keeps the environment current and avoids package errors later. - Access Windows files from Linux. Your Windows drives are mounted under
/mnt/c,/mnt/d, and so on. For example,cd /mnt/c/Users/YourNametakes you to your Windows user folder. - Access Linux files from Windows. In File Explorer, type
\\wsl$\in the address bar and press Enter. You can also use\\wsl.localhost\on newer builds. This opens your Linux home directory. - Shut down WSL cleanly when needed. WSL runs in the background. To stop all distributions, run
wsl --shutdownin PowerShell. This is useful after configuration changes or when the environment becomes unresponsive.
Common Mistakes
- Skipping the restart. The
wsl --installcommand often appears to succeed but the distribution will not launch until Windows reboots. - Forgetting the UNIX password. The Linux password is separate from your Windows password. If you lose it, you can reset it by entering the distribution as root with
wsl -u rootand runningpasswd yourusername. - Editing Linux files with Windows tools. Using Notepad or other Windows editors on files inside the Linux filesystem can corrupt permissions and line endings. Edit Linux files from inside WSL, and Windows files from Windows.
- Assuming WSL 2 is active. Some older setups default to WSL 1. Check with
wsl -l -vand convert if needed. - Ignoring virtualization. If
wsl --installfails with a virtualization error, the feature is disabled in firmware. Enable Intel VT-x or AMD-V in BIOS/UEFI. - Running
wslfrom a non-admin prompt during first install. The initial enablement needs elevation; later launches do not.
Tips
- Set a default distribution with
wsl --set-default Ubuntuif you install more than one. - Use Windows Terminal for a better experience: it supports multiple tabs, including PowerShell and WSL side by side.
- Keep projects on the Linux side (
~/projects) rather than under/mnt/cfor much faster file operations, especially with tools like Git and Node.js. - Install
wslu(a set of utilities) inside Ubuntu to open Windows apps and browsers from Linux with commands likewslview. - Back up your distribution occasionally with
wsl --export Ubuntu backup.tarand restore withwsl --import. - Check for WSL updates with
wsl --update; the kernel is updated separately from Windows.
Troubleshooting
- “WSL 2 requires an update to its kernel component.” Run
wsl --updatein an admin PowerShell. If that fails, download the kernel update package from Microsoft’s WSL documentation page and install it manually. - “The Windows Subsystem for Linux optional component is not enabled.” Open “Turn Windows features on or off”, tick “Windows Subsystem for Linux” and “Virtual Machine Platform”, reboot, then retry.
- Virtualization error. Enter BIOS/UEFI and enable virtualization (Intel VT-x or AMD-V). On some laptops it is labelled “SVM” or “Vanderpool”.
- Distribution launches but hangs. Run
wsl --shutdown, then relaunch. If it persists, export your data and reinstall the distribution. - Forgotten password. Launch with
wsl -u root, thenpasswd <username>to set a new one. - Networking issues. WSL 2 uses a virtual network. If DNS fails, check
/etc/resolv.confand consider disabling the auto-generated file via/etc/wsl.conf. Restart WSL after changes. - “No installed distributions.” The install may have failed silently. Run
wsl --install -d Ubuntuexplicitly, or list available distributions withwsl --list --online.
Frequently Asked Questions
Do I need a separate Linux installation?
No. WSL runs a real Linux kernel in a lightweight virtualized layer managed by Windows. You do not dual boot or install a full Linux OS separately.
Is WSL the same as a virtual machine?
No. WSL 2 uses a lightweight utility VM behind the scenes, but it integrates tightly with Windows: you can run Windows executables from Linux and access both filesystems directly. A traditional VM runs a full guest OS with its own boot process.
Can I run graphical Linux apps?
Yes, on Windows 11 and recent Windows 10 builds, WSL supports GUI apps through WSLg without extra setup. Launch them from the Linux shell and a window appears.
How do I uninstall WSL?
Run wsl --unregister <DistributionName> to remove a distribution and its data, then optionally disable the Windows features. Unregistering deletes files, so export first if you need them.
Does WSL work on Windows 10 Home?
Yes, on version 2004 (build 19041) and later. Earlier builds required manual feature enablement and had more limitations.
Where are my Linux files stored?
Inside a virtual disk file (ext4.vhdx) under your user profile’s AppData folder. Access them from Windows via \\wsl$\ rather than browsing the virtual disk directly.