Linux For Windows Logo




Installing Linux Using Windows Subsystem for Linux (WSL)

Last Modified:November 7, 2019

The Windows Subsystem for Linux is Microsoft's implementation of Linux for Windows. It provides services and environments for running native user-mode Linux shells and tools on Windows. Here are our detailed Step-by-Step instructions with pictures to install the Windows Subsystem for Linux as well as a Linux Distribution.


Installation

Installation can be broken down into 2 distinct phases:

  1. Phase I - Enabling Windows to Run Linux (which can be performed in two ways)
  2. Phase II - Installation of the Linux Software

Phase I - Enabling Windows to Run Linux

Below you will find 2 step-by-step processes to enable windows to run linux. Enabling windows to run Linux can be done via the command line through powershell, or via the GUI (Graphical User Interface). You only need to perform one of these enabling methods.

Through the GUI

Step-by-step process to enable Windows to Run linux via point and clicking. If you perform this method of enabling, you do not need to do the Command Line method.

  1. You must first prepare or enable windows to run the Linux environment. This is accomplished by first going to the settings options on your computer.
    Installing Windows Subsystem for Linux 01
  2. Under the Windows Settings, choose the Apps option.
    Installing Windows Subsystem for Linux 02
  3. Under the Apps & Features section, choose the Programs and Features item option near the right of the screen.
    Installing Windows Subsystem for Linux 03
  4. You should see the area where you can Uninstall or Change a Program. Near the left, you should see a heading called Turn Windows features on or off. Click on this.
    Installing Windows Subsystem for Linux 04
  5. A list will appear with different features for Windows which can be turned on or off. Scroll down the alphabeticalized list to the option called Windows Subsystem for Linux. Place an "check mark" next to this option.
    Installing Windows Subsystem for Linux 05
  6. Once selected, press the OK button.
  7. A popup windows will appear stating "Searching for required files".
    Installing Windows Subsystem for Linux 06
  8. Once it finds the files, it will change to "Applying changes".
    Installing Windows Subsystem for Linux 07
  9. Once the changes are applied, the popup will change to "Windows completed the requested changes. Windows needs to reboot your PC to finish installing the requested changes."
    Installing Windows Subsystem for Linux 08
  10. You have the option to "Restart Now" or "Don't Restart". Click on the Restart Now button.
  11. Your system will restart. During the shutting down process, you will see the screen "Working on Updates", with a percentage of completion. Allow this to complete.
    Installing Windows Subsystem for Linux 09
  12. During the startup process, you will see a screen stating "Working on Feature" with a percentage of completion. Allow this to complete.
    Installing Windows Subsystem for Linux 10
  13. You are done! You can proceed to Phase II - Installation of the Linux Software

Command Line Method

Since linux is a command line tool, it may make sense to dive right in and setup Linux for Windows using only the command line. Here is a step-by-step guide to enable Linux for Windows from the command line. (Note: if you performed the GUI Method to enable, you do not need to perform the Command Line Method)

  1. Run the Powershell as administrator. This is accomplished by searching your PC for "powershell", then right-click on the "Windows Powershell" results, and "Run as administrator". A pop-up will appear stating "Do you what this app to make changes to your device?". Click the Yes box.
  2. A blue box will appear stating "Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS C:\WINDOWS\system32>
  3. At the prompt, type in the following:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  4. Once the command completes successfully, type in "exit" and hit enter.
  5. It will prompt you to restart your computer.
  6. Done. You are ready to install a distribution of Linux

Phase II - Installation of the Linux Software

Once you have completed Phase I (enabling windows to run linux), you can now proceed with Phase II, the installation of Linux. Microsoft made this process easy by placing linux into the Microsoft Store.

  1. Go to the Microsoft Store.
    Installing Windows Subsystem for Linux 11
  2. In the Search Box in the top right of the screen, type in "linux", then press "Enter".
    Installing Windows Subsystem for Linux 12
  3. You may see a box stating "Linux on Windows? Totally. Click on Get the Apps.
    Installing Windows Subsystem for Linux 13
  4. You will see a box stating Run Linux on Windows. Install and run Linux distributions side-by-side on the Windows Subsystem for Linux (WSL). Now you have a choice. Which distribution to install. All free. The current options are Ubuntu, openSUSE Leap, SUSE Linux Enterprise Server, Debian / GNU Linux, or Kali Linux.
    Installing Windows Subsystem for Linux 14
  5. Click on your flavor of Linux. In our case, we have chosen Ubuntu.
  6. A popup will appear with more information about the Linux you have chosen. Click on the Get button.
    Installing Windows Subsystem for Linux 15
  7. It may ask you to log in with your Microsoft credentials. If you do not have a Microsoft userid or password, just continue as though you do, then cancel.
  8. The Linux distribution will download and install.
    Installing Windows Subsystem for Linux 16
  9. Once installed, it will prompt you to "Launch" or "Pin to Start". Choose Launch
    Installing Windows Subsystem for Linux 17
  10. A black box will appear stating "Installing, this will take a few minutes..."
    Installing Windows Subsystem for Linux 18
  11. After a few minutes it will state: "Please create a default UNIX user account. This username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username:"
    Installing Windows Subsystem for Linux 19
  12. Enter a username. In our case, we entered "johndoe". Hit "Enter".
    Installing Windows Subsystem for Linux 20
  13. It will then state "Enter new UNIX password:". Enter in a new password, then hit enter. Note: The password you type will not appear on the screen.
    Installing Windows Subsystem for Linux 21
  14. It will then prompt "Retype new UNIX password:". Re-enter the password you typed in on the previous step. Once again, the password will not appear on the screen. If the passwords match and are valid, it will state "passwd: password updated successfully". If it didn't like your password, it will give you a reason, and allow you to type in a new password again.
    Installing Windows Subsystem for Linux 22
  15. Once your password is successfully changed, it will state "Installation successful! To run a command as administrator (user "root"), use "sudo ". See "man sudo_root" for details." It will then show your userid@hostname. In our case "johndoe@AcerUpstairs:~$"
    Installing Windows Subsystem for Linux 23
  16. You are Done!

Installation Complete, Now what?

You have successfully installed Linux for Windows. If you are completely new to Linux, here is where the fun begins. You have a working version of Linux running on your Windows system. If you are finished for the day, just type in "exit" followed by enter, and the black box will close, thereby closing your linux instance.