Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Enable WSL on Windows 10: Complete Installation Guide

How to Enable WSL on Windows 10: Complete Installation Guide

Windows Subsystem for Linux (WSL) is a powerful feature that allows you to run a Linux environment directly on Windows 10 without the need for a virtual machine or dual boot setup. Enabling WSL opens up a world of development tools, scripting capabilities, and Linux applications, making it an essential tool for developers, sysadmins, and tech enthusiasts alike. Whether you’re looking to develop in a Linux environment, run Linux-based scripts, or just explore Linux on your Windows machine, this guide will walk you through the process step-by-step. Before you begin, ensure your Windows 10 version is up to date, as WSL 2 requires Windows 10 version 1903 or higher with Build 18362 or later. You may also want to back up your important data, just in case, although the process is generally safe and reversible.

What You’ll Need

  • A Windows 10 PC running version 1903 or higher (preferably latest updates)
  • Administrative privileges on your Windows account
  • Internet connection for downloading updates and Linux distributions

Step-by-Step

  1. Check your Windows version: Click on the Start menu, type “winver,” and press Enter. Ensure your version is 1903 or higher. If not, update Windows through Settings > Update & Security > Windows Update.
  2. Enable the Windows Subsystem for Linux feature: Open PowerShell as Administrator (right-click Start, select Windows PowerShell (Admin)). Type the following command and press Enter:
     dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 
  3. Enable the Virtual Machine Platform feature (required for WSL 2): In the same PowerShell window, run:
     dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart 
  4. Restart your computer: After enabling both features, restart your PC to apply the changes.
  5. Set WSL 2 as the default version: Once restarted, open PowerShell again as Administrator and run:
     wsl --set-default-version 2 

    This ensures future Linux distributions will use WSL 2 for better performance.

  6. Download a Linux distribution: Visit the Microsoft Store, search for your preferred Linux distro (such as Ubuntu, Debian, or Kali Linux), and click “Get” or “Install” to download and install it.
  7. Launch your Linux environment: After installation, open the Start menu, find your Linux distribution, and click to launch. The first time, it will take a few moments to set up. Follow on-screen prompts to create a user account and password.
  8. Update your Linux environment: Inside the Linux terminal, run:
     sudo apt update && sudo apt upgrade 

    to ensure all packages are current and secure.

Common Mistakes

  • Not updating Windows to the required version before attempting to enable WSL.
  • Forgetting to restart after enabling Windows features, which can cause WSL not to function properly.
  • Trying to install Linux distributions before enabling the required features or setting WSL 2 as default.
  • Using an outdated Linux distribution that defaults to WSL 1, which has less performance and compatibility.
  • Skipping the upgrade to WSL 2 after installation, missing out on performance improvements.

Tips

  • Always keep Windows updated for compatibility and security improvements.
  • Use the latest WSL 2-compatible Linux distributions for the best experience.
  • Set WSL 2 as default to future-proof your environment:
     wsl --set-default-version 2 
  • Explore WSL commands like
    wsl

    ,

    wsl --list --verbose

    , and

    wsl --set-version <DistroName> 2

    for managing your Linux environments efficiently.

  • Use Windows Terminal for a more flexible and powerful command-line experience, supporting multiple tabs and profiles.

Troubleshooting

If WSL does not activate as expected or encounters errors, try these steps:

  • Ensure your Windows is fully updated and restart after enabling features.
  • Check if the features are enabled correctly: Go to Control Panel > Programs > Turn Windows features on or off, and verify that “Windows Subsystem for Linux” and “Virtual Machine Platform” are checked.
  • If WSL 2 is not set as default, run
    wsl --set-default-version 2

    in PowerShell.

  • Reinstall the Linux distribution: Uninstall it from the Microsoft Store, then reinstall.
  • Disable and re-enable the features if problems persist, then restart and try again.
  • Ensure virtualization is enabled in your BIOS/UEFI settings, as WSL 2 relies on hardware virtualization.

Frequently Asked Questions

Can I run graphical Linux applications on WSL?
Yes, with WSL 2 and Windows 10 version 2004 or higher, you can run Linux GUI apps using Windows’ built-in support or third-party tools.
Is WSL 2 faster than WSL 1?
Generally, yes. WSL 2 uses a real Linux kernel and offers improved file system performance and compatibility.
Do I need Hyper-V to use WSL 2?
Hyper-V features are required for WSL 2, but you don’t need to enable Hyper-V explicitly; enabling Virtual Machine Platform suffices.
Can I run multiple Linux distributions simultaneously?
Yes, you can install multiple distributions and run them independently on WSL.
How do I switch between WSL 1 and WSL 2?
Use the command

wsl --set-version <DistroName> 1

or

wsl --set-version <DistroName> 2

.

Is WSL secure?
WSL is designed with security in mind, but always keep your Windows and Linux environments updated to mitigate vulnerabilities.

This comprehensive guide should help you enable and start using WSL on your Windows 10 machine smoothly, unlocking a powerful Linux environment right within Windows.

Related

How to Enable WSL on Windows 10: Complete Installation Guide
Scroll to top