Install Linux on Windows with WSL

Install a Linux distribution using the Windows Subsystem for Linux (WSL), which enables you to use Linux tools on you Windows File System.

Install WSL | Microsoft Learn

Prerequisites

  • Windows 10 version 2004 or higher (Build 19041 or higher)
  • Windows 11

Install WSL Command

From an elevated PowerShell or Command Prompt run the below command and you will need to reboot once complete. The command only works if WSL is not installed (See next section to determine WSL version & installed Linux distros), and by default will install Ubuntu (This can be change by specify -d <distributionname> in the command below).

wsl --install

After you reboot, the Ubuntu install will finish up and prompt you to create a username and password (Does not need to match your Windows username).

List and Install Linux Distributions

See a list of available Linux Distributions available for download through the Microsoft Online Store, run the below from an elevated PowerShell or Windows Command Prompt:

wsl --list --online

See a list of Linux Distributions installed

wsl --list -verbose

Install Linux Distribution

wsl --install -d <Distro>
wsl --install -d Debian

Ways to Run Multiple Linux Distributions with WSL

  1. Install Windows Terminal (Recommended). Open as many tabs or Window panes to quickly switch between multiple Linux Distros or other command lines (PowerShell, Command Prompt, Azure CLI, etc). This can be installed by search Windows Terminal in the Microsoft Store.
  2. Click Windows Start menu and start typing the name of the distro such as Ubuntu
  3. From PowerShell or Windows Command Prompt, you can enter the name of your installed distro such as ubuntu
  4. From PowerShell or Windows Command Prompt, open your default Linux distro by entering wsl.exe
  5. From PowerShell or Windows Command Prompt, you can use the default Linux distro

Access Linux File System from Windows

In the Windows Explorer address bar enter \\wsl$ and you will be able to access a hidden file share for your Linux Distros.

Access Windows File System from Linux

In your Linux Distro, it automatically mounts all of your Windows drives (ex: C:). You can list them by running

ls /mnt

Comments have been disabled.