TechBuzzPro

How to Install and Use WSL on Windows 11

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can install and use Windows Subsystem for Linux (WSL) on Windows 11 to run a full Linux environment directly on your PC without a virtual machine. This allows you to use Linux command-line tools, utilities, and applications alongside Windows apps. The process involves enabling WSL, installing a Linux distribution from the Microsoft Store, and setting it up with a user account. Menu labels may vary slightly depending on your Windows build, region, or device.

What You'll Need

  • A Windows 11 PC (version 21H2 or later recommended)
  • Administrator access to your computer
  • An active internet connection
  • At least 4–8 GB of free disk space (more for multiple distributions)
  • Microsoft Store access (to download Linux distributions)

Step-by-Step

  1. Open the Start menu, type "PowerShell", right-click on Windows PowerShell, and select "Run as administrator". Click Yes if prompted by User Account Control.
  2. In the PowerShell window, type the following command and press Enter:
    wsl --install
    This single command enables the required Windows features, installs WSL, sets WSL 2 as the default, and installs Ubuntu as the default Linux distribution.
  3. Wait for the command to complete. It may take several minutes. If prompted, restart your computer when instructed.
  4. After rebooting, Ubuntu will launch automatically. Wait for the installation to finish, then you'll be prompted to create a new Linux user account. Enter a username (this does not have to match your Windows username) and press Enter.
  5. Type and confirm a strong password for the Linux user. Note: the password will not display as you type.
  6. Once setup is complete, you can launch WSL from the Start menu by typing "Ubuntu" or using the command wsl in Command Prompt or PowerShell.
  7. To verify WSL 2 is running, open PowerShell as administrator and enter:
    wsl -l -v
    This lists all installed distributions and their WSL version. Ensure the version next to your distro is "2".
  8. If you prefer a different Linux distribution (e.g., Debian, Kali Linux, or openSUSE), open the Microsoft Store, search for the distribution, and click "Get" or "Install". After installation, launch it from the Start menu and set up a user account when prompted.
  9. To set a specific distribution as default, open PowerShell and type:
    wsl --set-default <DistributionName>
    Replace <DistributionName> with the exact name shown in wsl -l.
  10. To update WSL to the latest version at any time, run in PowerShell as admin:
    wsl --update

Common Mistakes

  • Skipping the administrator rights step: WSL installation requires elevated privileges. Always run PowerShell or Command Prompt as administrator.
  • Not restarting after installation: the system needs a reboot to finalize WSL feature activation. Skipping this may cause launch failures.
  • Using weak or reused passwords: the Linux user password is independent of Windows and should be secure.
  • Assuming GUI apps work by default: WSL primarily supports command-line tools. For GUI Linux apps, you must set up a Windows-compatible X server or use WSLg (built into Windows 11, usually enabled automatically).
  • Ignoring disk space: some distributions require several GB. Ensure adequate free space before installing multiple distros.

Tips

  • Use wsl --list --verbose (or wsl -l -v) to check which distributions are installed and their state (running/stopped).
  • Access Windows files from WSL via /mnt/c/ (for the C: drive). For example: cd /mnt/c/Users/YourName.
  • Access WSL files from Windows by opening File Explorer and typing \wsl$\Ubuntu in the address bar (replace "Ubuntu" with your distro name).
  • Keep WSL updated using wsl --update to benefit from performance and security fixes.
  • Use Windows Terminal (available in Microsoft Store) for a better experience with tabs, themes, and multiple shells.

Troubleshooting

If WSL fails to install or launch:

  • Ensure virtualization is enabled in BIOS/UEFI. Restart your PC, enter firmware settings (usually by pressing F2, F12, or Del during boot), and enable Virtualization Technology (VT-x or AMD-V).
  • Run wsl --install again in admin PowerShell. It will attempt to fix incomplete installations.
  • Manually enable features if the install command fails. In admin PowerShell, run:
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    Then restart and run wsl --set-default-version 2.
  • If a distribution fails to launch, reset it via Settings > Apps > Apps & features, find the distro, click Advanced options, then Reset. This does not remove your files but may require reconfiguring settings.
  • Check for Windows updates. Some WSL features require the latest cumulative updates.

Frequently Asked Questions

Can I run any Linux distribution with WSL?

Yes, most major distributions are available via the Microsoft Store, including Ubuntu, Debian, Kali Linux, and Alpine. Custom or unsupported distros can be imported manually using wsl --import.

Does WSL work without internet?

Initial installation requires internet to download components and the Linux kernel. Once installed, WSL can run offline, but updates and package installations will need connectivity.

Can I run Docker inside WSL?

Yes. Install Docker Desktop for Windows and enable the WSL 2 backend in Settings > Resources > WSL Integration. This allows Docker to run containers inside WSL distributions.

Is WSL the same as a virtual machine?

No. WSL is a compatibility layer, not a full VM. It runs Linux binaries directly on Windows via a lightweight utility VM, offering better performance and tighter integration than traditional virtualization.

Can I install GUI Linux applications?

Yes, on Windows 11, WSLg supports GUI apps by default. Install an app like GIMP or Firefox in your Linux distro and launch it. The window will appear in Windows.

How do I uninstall a WSL distribution?

Go to Settings > Apps > Apps & features, find the Linux distribution, click the three dots, and select Uninstall. Alternatively, use wsl --unregister <DistributionName> in PowerShell.