How to install WSL on Windows 10
WSL, the Windows Subsystem for Linux, is a free, optional feature of Windows 10 that allows Linux programs to run on Windows. It provides you with a Windows version of the bash shell and a compatibility layer that permits many Linux programs to run natively on your Windows machine.
Before installing WSL, make sure that your computer meets the minimum system requirements to run WSL:
- You must be running Windows 10 version 1607 (the Anniversary update) or above.
- WSL will only run on 64-bit versions of Windows 10. 32-bit versions are not supported.
To check that you meet these requirements, follow these steps:
- Open your Settings. You can do this by clicking the gear icon on the Start menu, or by opening the Power User Tasks menu and choosing Settings.
- In the Settings window, choose System.
- On the left side of the System window, choose About.
- On the right side of the window, system information is displayed. Make sure the Version is at least 1607, and the System type is a 64-bit operating system.
If the Version number is less than 1607, you need to perform a Windows Update before installing WSL.
If the System type is not a 64-bit operating system, you cannot run WSL.
To install WSL, follow these steps.
Versions of Windows previous to the Fall Creator's update required slightly different instructions. The instructions on this page are current as of May 2019.
- Open a new PowerShell window as Administrator. To do this, open your Start menu, scroll down to W, and expand the Windows PowerShell folder. Right-click Windows PowerShell, choose More, then Run as administrator.
- At the PowerShell prompt, run the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Some necessary software will download, and the WSL subsystem will be enabled after you reboot. Linux itself is not installed yet, however (until you choose a Linux distribution, in step 5.)
- When the download is complete, PowerShell will ask if you're ready to reboot the computer. Before rebooting, make sure any documents are saved, and any open applications are closed. Type Y, or if you're going to reboot later, type N instead.
- After your computer reboots, log in to Windows and open a new Command prompt (or PowerShell). At the prompt, run:
- Bash will inform you that no distribution is installed, and give you a URL for downloading one from the Windows Store:
Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Windows Store: https://aka.ms/wslstore Press any key to continue...
- In a web browser, navigate to the URL https://aka.ms/wslstore to download a WSL-integrated Linux distribution. As of this writing, choices are Ubuntu, OpenSUSE, SUSE Enterprise Server, Debian, and Kali. If you're not sure what to pick, we recommend Ubuntu.
- Click the distribution of your choice, then click Get.
- When the installation is complete, click Launch. You will see this message:
Installing, this may take a few minutes...
It may silently wait for you to press a key after it's done, so you might want to press Backspace every 15 seconds or so, to check if it's finished.
You may receive this error:
Installing, this may take a few minutes... Installation failed! Error: 0x8000000d Press any key to continue...
This error is a known bug that has occurred in some versions of Windows 10. If you get this error, you can fix it by repeating steps 1 and 2. Then, continue to step 10.
- Ubuntu is now installed, and WSL is enabled. You can open the WSL Ubuntu command prompt by clicking the Launch button in the Windows Store or in the Start menu by choosing Ubuntu. You can also open a command prompt (or PowerShell) and run bash.
Getting started with your Linux subsystem
The first time you run your WSL distribution, you will be asked to create a user account. It can be different than your Windows username. You will also be asked to set a password.
Congratulations! Linux is running. You're now at the bash prompt, and you can run Linux commands and programs.
Update your Linux software
Now is a great time to perform a software update. Follow the instructions below to update your software with the apt command.
Like Ubuntu, WSL uses the APT (advanced packaging tool) to manage software packages. The apt command allows you to search for, download, and install software, all from the command line. It automatically manages your software dependencies for you, so if one program depends on a certain version of another program, both will be installed, and kept up-to-date.
Any apt commands that make changes to your system must be run as root. If you're logged in as your regular user (as you usually should be), you can run a program as root by prefixing it with the command sudo ("superuser do"). It requires that you enter your password, and your program is run as root.
sudo apt update
[sudo] password for hope:
Updates will download, but nothing is installed or upgraded yet. To upgrade all available packages, run:
sudo apt upgrade
Sudo will not ask you for your password this time, unless more than five minutes have elapsed since the last sudo command.
The size of the upgrades will be calculated, and you will be prompted to continue. Type y and press Enter. The upgrades will download and install, which might take a while, depending on the speed of your computer and Internet connection.
When the upgrade is complete, you will be returned to the bash prompt. Your Linux system is now up-to-date.
At any time, you can exit bash using the exit command.
The Windows and WSL filesystems
WSL has its own filesystem. This Linux filesystem is installed to your Windows filesystem at the following location:
For instance, if your Windows username is Owner and Windows is installed on your C: drive, your WSL filesystem is located at:
It's good to know that this is where it's located, but you shouldn't move or make any changes to the files it contains.
When you're using WSL, you might be wondering how you can access your Windows files. Your C: drive is located at:
The name mnt stands for "mount," which is where your Windows drives are mounted within WSL. For instance, your D: drive would be /mnt/d/, etc.
Creating links to Windows folders
For convenience, it's a good idea to create symbolic links to your Windows home folder. A symbolic link is similar to a shortcut in Windows: it's a file that points to another file or directory. When you refer to the symbolic link, the system will dereference the link, and behave as if you had specified the actual "target" file or directory.
Using symbolic links can save you a lot of typing, and remembering of obscure directory names.
For instance, to create a symbolic link in your WSL home folder called winhome that refers to C:\Users\Owner\, follow these steps.
Next, use ln -s to create the symbolic link. For instance, if your Windows home folder is C:\Users\Owner\, the command would be:
ln -s /mnt/c/Users/Owner/ winhome
Now there's a symbolic link called winhome in your WSL home directory, which acts like a shortcut to your Windows home directory. So, you can change to your Windows home directory using:
Or, to change to your Windows desktop folder:
More information about Linux commands
Enjoy your new Linux subsystem! Make sure to visit our overview of Linux commands for more information about tools and programs you can use.