Microsoft continues to invest on making Windows 10 the best productivity operating system. But did you know?, You can download and run Linux on Windows 10 natively. Yes, It is possible and we are talking about the Linux Bash shell. Bash shell is simply a command-line utility that has been part of Linux for a long time, and it’s often used by developers. It’s all thanks to the Windows Subsystem for Linux (WSL). This is a feature which allows you to quickly and easily install and run one of many Linux distribution in a matter of minutes on Windows operating system.
But don’t get confused, this isn’t Linux on Windows either, unlike the real Bash shell you will find in Linux, the version of the command line utility has some limitations with Windows. For example, the Windows Subsystem for Linux (WSL) is not designed to run Linux graphical applications (e.g. KDE, Gnome, etc.) on Windows 10. The tool is only to offer developers a text-based command-line feature to run Bash and core Linux tools within Windows 10 operating system.
In this step by step guide, we will walk you through the steps to install and use Windows Subsystem for Linux (WSL) command-line tool on your Windows 10 PC.
Outline of this post:
- Enable Windows Subsystem for Linux (WSL) on Windows 10
- Download & install Linux distribution from Microsoft Store
- Use Ubuntu Bash Shell in Windows 10
- Play with Linux commands in Ubuntu Bash shell
How to enable Windows Subsystem for Linux (WSL) on Windows 10
Unlike installing Linux in a virtual machine, the Windows Subsystem for Linux (WSL) can be instantly called from the Start menu. However, before you can use Linux Bash shell in Windows 10, you need to turn it on. Here’s how.
Step 1: Open Search and type Turn Windows features on or off and select the result.
Step 2: In the Windows Features, check the Windows Subsystem for Linux option and click OK.
Step 3: Click the Restart now button to finish installation of Windows Subsystem for Linux.
How to download & install Linux distribution (Ubuntu) from Microsoft Store
Once the Windows Subsystem for Linux (WSL) is installed on Windows 10, the next step is to download a Linux distribution from Microsoft store, which will give you access to the Linux Bash shell on your Windows 10 PC. Here are the steps which you need to follow:
Step 1: Open Microsoft Store from the Start menu, and search for “Linux” in the store. You will see a list of every Linux distribution currently available in the Microsoft Store. As of writing this article, Microsoft Store includes Ubuntu, openSUSE Leap, openSUSE Enterprise, Debian Linux and Kali Linux.
For the demonstration of this article we are going to install Ubuntu Linux distribution from Microsoft Store but you are free to choose any other Linux distribution of your choice.
To install Ubuntu Linux distribution, select it, and then click the “Get” button to install it like any other Microsoft Store application.
Step 2: Download process will being once you hit “Get” button. It takes few minutes to download and install Ubuntu Linux on your Windows 10 PC.
You can also install multiple Linux distributions and they will each get their own unique shortcuts. You can even run multiple different Linux distributions at a time in different windows.
How to use Ubuntu Bash shell in Windows 10
In our previous section we had successfully installed Ubuntu from Microsoft store. In this section we will learn how to start and use Ubuntu Bash shell in Windows 10. Just follow the step by step instructions below:
Step 1: Open Search and type Ubuntu and select the result.
Step 2: The system will then take a few minutes to install Ubuntu in the command prompt window.
Step 3: You will be prompted to enter a UNIX username and password. These don’t have to match your Windows username and password, but will be used within the Linux environment.
For example, if you enter “sunil_linux” and “demo@123” as your credentials, your username in the Ubuntu Linux environment will be “sunil_linux” and the password you use inside the Ubuntu Linux environment will be “demo@123”. Finally, you are taken into the Ubuntu Bash shell, which you can see in the next figure.
At this point, you can now use the Ubuntu Bash shell as if you were on a computer with Ubuntu installed as its primary OS.
Play with Linux commands in Ubuntu Bash shell
In our last section we have configured Ubuntu environment by setting username and password, now we are ready to play with Linux commands inside Windows 10 as if we are using Linux PC. Type below commands one by one to play around in Bash shell.
apt help : It demonstrate the usage of the package manager.
sudo apt update : Use this command to get the latest packages, as you are on a Linux PC.
sudo apt upgrade : Use this command to upgrades Linux to the latest version of the OS.
Meanwhile, other standard commands are available. You can check your network connectivity with
ifconfig, check the current directory with
pwd, and change to a different directory with
cd. In short, it’s just like using Linux within the Windows 10 operating system.
We hope this article helped you learn how to activate WSL then download Linux distribution from Microsoft Store and finally use it under Windows 10 environment. This is not everything what we have covered here, we also recommend WSL guide on Github from Michael treat. It covers some of the same information we have covered in this article, but is written specifically to help developers new to WSL set up their work environment and understand how the Windows and Linux file systems interact.
Similar articles you may like
- How to install Windows 10 on Oracle VirtualBox
- How to password protect a folder in Windows 10
- How to use Windows 10 new cloud based clipboard
- How to enable and use Windows Sandbox in Windows 10