This guide walks you through installing the Windows Subsystem for Linux (WSL) on Windows 11, giving you a full Linux environment directly on your Windows machine without a virtual machine. You’ll learn the quickest method (a single command), the manual fallback, and how to install a Linux distribution. By the end, you’ll be able to open a Linux terminal and run Linux commands natively on Windows.
What You’ll Need
- A PC running Windows 11 (version 21H2 or later).
- Administrator access to your PC (you’ll need to approve a UAC prompt).
- An internet connection to download the necessary components and Linux distribution.
- Virtualization enabled in your BIOS/UEFI (most modern PCs have it on by default; if not, you’ll need to enable it—see Troubleshooting).
Step-by-Step
- Open PowerShell or Windows Terminal as Administrator. Right-click the Start button and select “Terminal (Admin)” or “Windows PowerShell (Admin)”. Click “Yes” when the User Account Control prompt appears.
- Run the WSL install command. Type the following and press Enter:
wsl --install
This command enables the required Windows features (Virtual Machine Platform and Windows Subsystem for Linux), downloads the latest WSL kernel, and installs the default Linux distribution (usually Ubuntu). - Restart your PC. When the command finishes, you’ll be prompted to restart. Save your work and restart to complete the installation.
- Wait for the first-launch setup. After restarting, the Linux distribution will finish installing. A console window will open asking you to create a UNIX username and password. Enter a username (lowercase, no spaces) and then a password (you won’t see characters as you type).
- Update your Linux packages. Once you’re at the Linux command prompt, run:
sudo apt update && sudo apt upgrade
Enter your password when prompted. This ensures your new Linux system is up to date. - Verify the installation. Type
wsl -l -vin PowerShell or Command Prompt to see your installed distributions and their status. You should see your distro listed with a state of “Running” or “Stopped”.
If you want a different Linux distribution, you can install one after WSL is set up. Open PowerShell and run wsl --list --online to see available distros, then wsl --install -d <DistroName> (e.g., wsl --install -d Debian).
Common Mistakes
- Running the install command without administrator privileges. The command will fail with an error about elevation. Always open Terminal or PowerShell as Admin.
- Not restarting after the install. WSL won’t work until you reboot. If you skip the restart, you’ll see errors about WSL not being enabled.
- Forgetting your Linux password. You can reset it later by running
wsl --user rootand then usingpasswd <username>, but it’s easier to remember it. - Installing a distro before WSL is ready. If you try to install a distribution from the Microsoft Store before running
wsl --install, you may get errors. Always set up WSL first.
Tips
- Use Windows Terminal. It offers a better experience with tabs and supports both PowerShell and WSL. It’s preinstalled on Windows 11, but you can install it from the Microsoft Store if needed.
- Access your Windows files from Linux. Your Windows drives are mounted under
/mnt/c/(for example,/mnt/c/Users/YourName/Documents). You can edit files in either system. - Run Linux commands from PowerShell. You can type
wsl <command>to run a single Linux command without opening the full shell. For example,wsl ls -la. - Set a default distribution. If you have multiple distros, use
wsl --set-default <DistroName>to choose which one opens when you typewsl. - Keep WSL updated. Run
wsl --updateperiodically to get the latest kernel and features.
Troubleshooting
The install command fails with “WSL is not installed” or “Virtual Machine Platform” error. This usually means virtualization is disabled in BIOS. Restart your PC, enter the BIOS/UEFI setup (usually by pressing Del, F2, or F12 during boot), find a setting called “Intel VT-x”, “AMD-V”, “SVM Mode”, or “Virtualization Technology”, and enable it. Then boot back into Windows and try again.
After restart, you get an error about “WSL2 requires an update”. Run wsl --update in an admin PowerShell to manually install the latest WSL kernel.
The Linux distro installs but won’t start. Open PowerShell and run wsl --shutdown, then try launching the distro again. If that fails, check that your Windows version is fully updated (Settings > Windows Update).
You see “The requested operation is not supported.” This can happen if you’re running an older Windows 11 build. Update Windows to the latest version and then run wsl --update.
Can’t find the Linux terminal after install. The distro appears in your Start menu under its name (e.g., “Ubuntu”). You can also type wsl in PowerShell or Command Prompt to launch it.
Frequently Asked Questions
Q: What is the difference between WSL and a virtual machine?
A: WSL runs a real Linux kernel but integrates tightly with Windows, allowing you to run Linux tools and Windows apps side by side. It uses fewer resources than a full VM and starts in seconds.
Q: Can I install WSL on Windows 10?
A: Yes, but the process is slightly different. You need to enable the “Windows Subsystem for Linux” feature manually and install WSL 2. This guide is specific to Windows 11, where the wsl --install command does everything.
Q: Do I need to enable Hyper-V?
A: No. WSL 2 uses a lightweight virtualization technology that is separate from Hyper-V. You don’t need to enable Hyper-V manually.
Q: Can I run GUI Linux apps?
A: Yes, WSL supports GUI applications (like GIMP or VS Code) on Windows 11. Just install the Linux app inside WSL, and it will open in a window like any Windows app.
Q: How do I uninstall WSL?
A: Open PowerShell as Admin and run wsl --unregister <DistroName> to remove a specific distro, or use “Apps & Features” to uninstall the distro. To remove WSL entirely, run wsl --uninstall.
Q: Can I access my Windows files from Linux?
A: Yes, your Windows drives are mounted under /mnt/. For example, your C: drive is at /mnt/c/. You can read and write files there.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Missing Scroll Bar in Chrome
- Fix Sony Vegas Crashing on Windows 10
- Fix Outlook Sent Items Missing? Quick Solutions
- Declutter Safari on iPhone: 15 Quick Tips
- Fix Google Maps Timeline Not Working on iPhone & Android
- How to Find Hidden Apps on iPhone (Unhide Guide)