Enabling the Windows Subsystem for Linux (WSL) adds a native Linux environment to Windows for development, automation, and troubleshooting without setting up a separate virtual machine or dual-boot installation.

The wsl.exe command installs and manages distributions and the underlying platform, with WSL 1 translating Linux system calls and WSL 2 running a real Linux kernel inside a lightweight virtualized environment for broader compatibility, including container workloads.

Because WSL 2 depends on hardware virtualization, firmware settings may need adjustment and a reboot is typically required after Windows features are enabled. For performance-sensitive work, file placement matters, since projects stored inside the distribution’s Linux filesystem usually perform better than the same files stored under /mnt/c.

Steps to enable Windows Subsystem for Linux (WSL) on Windows:

  1. Confirm the system is running Windows 10 version 2004 or later, or Windows 11.

    Use winver from Run to display the installed Windows version and build number.

  2. Enable hardware virtualization in firmware or BIOS when using WSL 2.

    Common labels include Intel VT-x, AMD-V, and SVM Mode.

  3. Open PowerShell or Windows Terminal as an administrator.
  4. Install WSL and a default Linux distribution using the built-in installer.
    wsl --install
    Installing: Windows Subsystem for Linux
    Installing: Virtual Machine Platform
    Installing: Ubuntu
    The requested operation is successful.
    Changes will not be effective until the system is rebooted.

    wsl.exe enables the required Windows features and installs a default distribution unless --no-distribution is used.

  5. Restart Windows to finish enabling the WSL components.
  6. Set WSL 2 as the default version for new distributions.
    wsl --set-default-version 2
    Default version of WSL set to 2

    New distributions default to WSL 2 after this change.

  7. Install additional Linux distributions from the Microsoft Store when required.

    Search for Ubuntu, Debian, or other supported distributions and select Install.

  8. Launch an installed distribution from the Start menu to complete first-run user creation.

    The first launch prompts for a new Linux username and password.

  9. Verify installed distributions and their WSL versions.
    wsl -l -v
    NAME      STATE           VERSION
    * Ubuntu    Running         2

    Switch an existing distribution to WSL 2 with

    wsl --set-version <distribution-name> 2

    when VERSION shows 1.