What WSL is and why you'd install it

Windows Subsystem for Linux (WSL) lets you run a Linux environment directly on Windows without needing a separate virtual machine or dual boot. It gives you access to Linux command-line tools, package managers, and development environments while staying in Windows. If you work with servers, write code that runs on Linux, or need tools that only exist in Linux, WSL bridges that gap.

WSL comes in two versions: WSL 1, which translates Linux system calls to Windows, and WSL 2, which runs a lightweight Linux kernel inside a virtual machine. WSL 2 is faster and more compatible with modern Linux software, so it's the version most people should install now.

You'll need Windows 10 version 2004 or later, or any version of Windows 11. If you're on an older build, Windows Update will offer the upgrade. Check your version by pressing Windows key + R, typing winver, and hitting Enter.

Key Takeaways

  • WSL 2 requires Windows 10 build 2004 or later, or Windows 11, and you can check your version in the winver dialog.
  • Enable two Windows features — Virtual Machine Platform and Windows Subsystem for Linux — through the Windows Features dialog or PowerShell.
  • Download and install a Linux distribution from the Microsoft Store, or use the command line to list and install distributions automatically.
  • Set WSL 2 as your default version before installing a distribution, so new distributions use the faster kernel by default.
  • Create a username and password when you first launch your Linux distribution, which is separate from your Windows login.

Enable the required Windows features

Before you can run Linux, you need to turn on two Windows features that are installed but disabled by default. The easiest way is through PowerShell. Right-click the Start button, select Windows PowerShell (Admin) or Terminal (Admin), and paste this command:

wsl --install

This single command enables both Virtual Machine Platform and Windows Subsystem for Linux, then downloads and installs Ubuntu (the most common distribution). Your computer will restart, and when it comes back up, Ubuntu will be ready to launch. You'll create a username and password the first time you open it.

If you prefer to enable the features manually instead, open the Start menu, search for Turn Windows features on or off, and click it. Check the boxes next to Virtual Machine Platform and Windows Subsystem for Linux, click OK, and restart when prompted.

Set WSL 2 as the default before installing a distribution

If you used the wsl --install command, WSL 2 is already set as default. If you enabled the features manually, you should set the default version before installing your first distribution. Open PowerShell as admin and run:

wsl --set-default-version 2

This ensures any new distributions you install will use WSL 2 by default. You can check which version a distribution is using later with wsl --list --verbose, and convert an existing WSL 1 distribution to WSL 2 with wsl --set-version [distribution-name] 2.

Choose and install a Linux distribution

If you ran wsl --install, Ubuntu is already installed and you can skip this section. Otherwise, you have several options. The easiest is the Microsoft Store: search for "Linux" or the name of a specific distribution like Ubuntu, Debian, or Fedora, and click Install. The distribution downloads and registers itself automatically.

From PowerShell, you can also list available distributions with wsl --list --online, then install one by name with wsl --install -d [distribution-name]. For example, wsl --install -d Debian installs Debian. This method is faster if you know which distribution you want.

Ubuntu is the most widely supported and has the most documentation online, so it's a safe choice if you're new to Linux. Debian is similar but more minimal. Fedora uses different package management tools. Pick whichever matches what you'll be running on actual servers, or start with Ubuntu and switch later if needed.

Launch your distribution and create a user account

Once installation finishes, open the Start menu and search for your distribution by name — Ubuntu, Debian, Fedora, or whatever you installed. Click it to launch. A terminal window opens and you'll see a prompt asking you to create a username and password.

This username and password are not your Windows login — they're specific to your Linux environment. You can use the same password as your Windows account, or a different one. You'll need this password later when you run commands that require administrator privileges inside Linux (using sudo).

After you create the account, you're in a Linux shell. You can now run Linux commands, install packages with apt (on Ubuntu or Debian) or dnf (on Fedora), and use development tools like Git, Python, Node.js, and Docker. Type exit to close the terminal, or just close the window.

Access your files and manage distributions

Your Windows files are visible from inside Linux at /mnt/c (C: drive), /mnt/d (D: drive), and so on. You can navigate there and edit files with Linux tools. Your Linux home directory is separate and not visible from Windows File Explorer by default, but you can access it by typing \\wsl$ in the Windows File Explorer address bar.

To manage your distributions, use PowerShell commands. wsl --list shows all installed distributions. wsl --terminate [distribution-name] shuts down a running distribution. wsl --unregister [distribution-name] removes it entirely. You can also set which distribution launches by default with wsl --set-default [distribution-name].

Troubleshooting common installation problems

If wsl --install fails, make sure you're running PowerShell as administrator. Right-click PowerShell and select Run as administrator. If you see an error about virtualization, restart your computer and try again — sometimes the feature needs a full restart to activate.

If your distribution won't launch after installation, try wsl --repair from PowerShell, which fixes registration issues. If you see "The system cannot find the file specified," uninstall the distribution from Settings > Apps > Apps & features, search for it by name, and reinstall it from the Microsoft Store.

WSL 2 requires virtualization to be enabled in your BIOS. Most modern computers have this on by default, but if you see errors about Hyper-V or virtualization, restart your computer, enter the BIOS (usually by pressing Delete, F2, or F12 during startup), and look for a setting called "Virtualization," "VT-x," or "AMD-V." Enable it, save, and restart.

Frequently Asked Questions

Can I run WSL on Windows 10 Home edition?

Yes. WSL works on Windows 10 Home, Pro, Enterprise, and Education editions. You need build 2004 or later. Check Settings > System > About and look for "OS Build" — if it's lower than 2004, run Windows Update to upgrade.

What's the difference between WSL 1 and WSL 2?

WSL 2 runs a real Linux kernel and is significantly faster, especially for file operations and running containers. WSL 1 translates system calls and is slower but uses less memory. Use WSL 2 unless you have a specific reason not to — most people should default to WSL 2.

Do I need to uninstall my current Linux distribution to switch to WSL 2?

No. Run wsl --set-version [distribution-name] 2 to convert an existing WSL 1 distribution to WSL 2 in place. The conversion takes a few minutes but keeps all your files and settings.

Can I access my Linux files from Windows?

Yes, but it's slower than accessing them from inside Linux. Type \\wsl$ in Windows File Explorer to browse your Linux home directory. For regular work, use Linux tools from inside WSL instead of editing files from Windows.

What if I want to uninstall WSL completely?

Uninstall each distribution from Settings > Apps > Apps & features by searching for it by name. Then disable the Windows features: open Turn Windows features on or off, uncheck Virtual Machine Platform and Windows Subsystem for Linux, and restart.