https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/install-wsl-windows-10_.jpg?itok=Coix48NC

Do you want to run Linux on Windows 10? Use WSL, here's how.

Yes, you can run Linux alongside Windows 10 without the need for a second device or virtual machine using the Windows Subsystem for Linux, and here's how to set it up.

by

Source: Windows Central

On Windows 10, the Windows Subsystem for Linux (WSL) is a feature that creates a lightweight environment that allows you to install and run supported versions of Linux (such as Ubuntu, OpenSuse, Debian, etc.) without the complexity of setting up a virtual machine or different computer.

Although you won't get a graphical interface, this approach enables developers and network administrators to use a long list of command tools and services (such as vim, tmux, andemacs, sshd, Apache, and MySQL), and run Bash shell scripts written in Python, Ruby, C#, F#, and many others using a command console.

Save up to 88% on a subscription to PureVPN for a limited time

In this Windows 10 guide, we'll walk you through the steps to install the Windows Subsystem for Linux using the Settings app as well as PowerShell. Also, we'll show you the instructions to download and install Linux distros, and the steps to properly remove all the components when you no longer need the open-source environment.

How to install Windows Subsystem for Linux using Settings

If you want to run distros of Linux on Windows 10, you must first enable the Windows Subsystem for Linux feature before you can download and install the flavor of Linux that you want to use.

Enabling Windows Subsystem for Linux using Settings

To install WSL using Setting on Windows 10, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/apps-features-programsfeatures-option.jpg?itok=4dfSoJP5
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/controlpanel-turn-windows-features-option.jpg?itok=dhXQwPGx
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/enable-windows-subsystem-linux-windows-10.jpg?itok=wtNcT-lS
  1. Open Settings.
  2. Click on Apps.
  3. Under the "Related settings" section, click the Programs and Features option. Source: Windows Central
  4. Click the Turn Windows features on or off option from the left pane. Source: Windows Central
  5. Check the Windows Subsystem for Linux option. Source: Windows Central
  6. Click the OK button.
  7. Click the Restart now button.

Once you complete the steps, the environment will be configured to download and run the distros of Linux on Windows 10.

Installing Linux distros using Microsoft Store

To install a distribution of Linux on Windows 10, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/linux-microsoft-store-download.jpg?itok=UK0_yRPP
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/install-ubuntu-microsoftstore.jpg?itok=u7Nkf-Wj
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/setup-ubuntu-wsl-windows10.jpg?itok=FUHqpLZb
  1. Open Microsoft Store.
  2. Search for the Linux distribution that you want to install. Some of the distros available include: Ubuntu. OpenSuse Leap 15. Kali Linux. Debian. Alpine WSL. Suse Linux Enterprise 12.
  3. Select the distro of Linux to install on your device. Source: Windows Central
  4. Click the Get (or Install) button. Source: Windows Central
  5. Click the Launch button.
  6. Create a username for the Linux distro and press Enter.
  7. Specify a password for the distro and press Enter. Source: Windows Central
  8. Repeat the password and press Enter to confirm.

After you complete the steps, you can start using the distro as any other flavor of Linux (without the graphical user interface, of course).

Uninstalling Linux distros using Settings

If you no longer need to run Linux on your device, it's recommended to remove the distros, and then disable WSL.

To uninstall a Linux distribution, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/v1909-2019-12-043612.jpg?itok=7-H-U8TH
  1. Open Settings.
  2. Click on Apps.
  3. Click on Apps & features.
  4. Under the "Apps & features" section, select the distribution — for example, Ubuntu.
  5. Click the Uninstall button. Source: Windows Central
  6. Click the Uninstall button again to confirm.

Once you complete the steps, the installation of Linux will be removed, and you can proceed with the steps to disable WSL.

Disabling Windows Subsystem for Linux using Settings

To disable the WSL on Windows 10, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/apps-features-programsfeatures-option.jpg?itok=4dfSoJP5
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/controlpanel-turn-windows-features-option.jpg?itok=dhXQwPGx
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/disable-wsl-windows-10.jpg?itok=2N_RxJ2y
  1. Open Settings.
  2. Click on Apps.
  3. Under the "Related settings" section, click the Programs and Features option. Source: Windows Central
  4. Click the Turn Windows features on or off option from the left pane. Source: Windows Central
  5. Clear the Windows Subsystem for Linux option. Source: Windows Central
  6. Click the OK button.
  7. Click the Restart now button.

After you complete the steps, the Windows Subsystem for Linux will be removed from your device.

How to install Windows Subsystem for Linux using PowerShell

Alternatively, if you don't have access to the Windows graphical interface, or you're comfortable using command lines, you can also use PowerShell to enable the Windows Subsystem for Linux, download and install distros of Linux, and revert all the changes.

Enabling Windows Subsystem for Linux using PowerShell

To install the Windows Subsystem for Linux using PowerShell, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/enable-wsl-powershell-windows-10.jpg?itok=uGUlFyLH
  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. Type the following command to enable the Linux subsystem and press Enter: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Source: Windows Central
  4. Type Y and press Enter to confirm and restart your computer.

Once you complete the steps, you can proceed with the instructions to download and install any compatible distribution of Linux available through the Microsoft Store.

Installing Linux distros using PowerShell

To download and install a distro of Linux (such as Ubuntu) with PowerShell, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/download-ubuntu-command-wsl-powershell.jpg?itok=UJqUQDoQ
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/install-ubuntu-wsl-powershell.jpg?itok=9pG1uCaX
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/setup-ubuntu-wsl-windows10.jpg?itok=FUHqpLZb
  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. Type the following command to select the download folder and press Enter: cd c:\PATH\TO\DESTINATION-FOLDER This example navigates to the data folder in the root of the main drive: cd c:\data
  4. Type the following command to download Ubuntu and press Enter: Invoke-WebRequest -Uri https://wsldownload.azureedge.net/Ubuntu_1604.2019.523.0_x64.appx -OutFile Ubuntu.appx -UseBasicParsing Source: Windows Central The above command downloads the Ubuntu version 16.04, but you may need to update the command with name and version of the distro that you're trying to download. Quick note: Although the link in this step and the one in the screenshot look different, they are actually the same. The one in the screenshot is just the short version.
  5. Type the following command to view the actual name of the installer and press Enter: dir
  6. Type the following command to install Ubuntu version 16.04 and press Enter: Add-AppxPackage .\APP-NAME.appx This example installs the Ubuntu distro on Windows 10: Add-AppxPackage .\Ubuntu.appx Source: Windows Central
  7. Open Start.
  8. Search for the recently distribution Linux distribution (for example, Ubuntu), click the top result to launch the experience.
  9. Create a username for the Linux distro and press Enter.
  10. Specify a password for the distro and press Enter. Source: Windows Central
  11. Repeat the password and press Enter to confirm.

After you complete the steps, you can start using Ubuntu or any other distro as you would on a full installation of Linux without a graphical interface.

Uninstalling Linux distro using PowerShell

If you want to revert the changes, you first want to remove any distros of Linux before disabling WSl.

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/get-appxpackage-wsl-name-powershell.jpg?itok=i5TIqmSY
https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/remove-linux-distro-wsl-powershell.jpg?itok=hNpZAFDC
  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. Type the following command to find out the distro name and press Enter: Get-AppxPackage *PARTIAL-DISTRO-NAME* This example search for the app package that includes "ubuntu" in the name: Get-AppxPackage *ubuntu* Source: Windows Central In the command, make sure to change "ubuntu" for the name of the distro you're trying to find.
  4. Type the following command to uninstall the version of Linux installed on your computer and press Enter: Get-AppxPackag FULL-DISTRO-NAME | Remove-AppxPackage This example removes the Ubuntu package from Windows 10: Get-AppxPackage CanonicalGroupLimited.Ubuntu16.04onWindows | Remove-AppxPackage Source: Windows Central In the command, make sure to change "CanonicalGroupLimited.Ubuntu16.04onWindows" for the name of the distro you're trying to remove.

Once you complete the steps, you can proceed to disable the Windows Subsystem for Linux feature on your computer.

Disabling Windows Subsystem for Linux using PowerShell

To disable WSL using PowerShell, use these steps:

https://www.windowscentral.com/sites/wpcentral.com/files/styles/large/public/field/image/2019/12/disable-wsl-powershell-command.jpg?itok=-hYBLq9b
  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. Type the following command to enable the Linux subsystem and press Enter: Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Source: Windows Central
  4. Type Y and press Enter to confirm and restart your computer.

After you complete the steps, the Linux environment will be disabled from your computer.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

We may earn a commission for purchases using our links. Learn more.

https://www.windowscentral.com/sites/wpcentral.com/files/styles/w200h150crop/public/field/image/2019/12/qualcomm-snapdragon-7c.jpg?itok=YEYRemWM

Recorded December 6th 2019 On this week's podcast .... RTM is still near, Snapdragon 7c, and more We're back with another exciting episode of the Windows Central Podcast, and this week, Zac Bowden and Daniel Rubino check out the most recent build of Windows 10 20H1 before discussing Qualcomm's new Snapdragon 7c and 8c processors and other announcements from the Qualcomm Snapdragon Summit.

https://www.windowscentral.com/sites/wpcentral.com/files/styles/w200h150crop/public/field/image/2019/07/acer-tc-885-lifestyle-02.jpg?itok=o_l28TF4

Buyer's guide These great desktop PCs won't cost you more than $500 Need a pre-built PC and have about five bills in your pocket? Finding the right device can be tough, but we've rounded up the best options out there right now to help you decide.

https://www.windowscentral.com/sites/wpcentral.com/files/styles/w200h150crop/public/field/image/2019/06/lenovo-thinkcentre-m720q-tiny-upright-01.jpg?itok=VQ2NyTne

Trade wars Chinese government offices told to remove foreign computer equipment The Chinese government told government offices and public institutions that they need to remove all foreign computer software and equipment within three years. The move could require between 20 and 30 million devices to be replaced in that timeframe.

https://www.windowscentral.com/sites/wpcentral.com/files/styles/w200h150crop/public/field/image/2016/01/ideacentre-stick-300-3.jpg?itok=Gz-LGCH1

Honey I shrunk the computer! These are the best PC sticks for when you're on the move Instant computer, just add a screen! That’s the general idea of the ultra-portable PC Compute Sticks, but it can be hard to know which one you want. Relax, we’ve got you covered.