How to Enable the Linux Bash Shell on Windows 10 [Supports WSL 2]

While everyone was busy writing off Microsoft, the Redmond giant went ahead and acquired the popular code-management platform, GitHub. On similar lines, Microsoft joined the Linux Foundation as a partner to bring support for Linux kernel on Windows 10. All these decisions indicate that Microsoft is serious about bringing software development and research on Windows 10. So if you are a student or a programmer, I will show how you can enable the Linux Bash Shell on Windows 10 and take advantage of this awesome feature. Not only that, but I will also share the steps to upgrade from Windows Subsystem for Linux (WSL 1) to the latest WSL 2 which packs lots of new improvements. With all that said, let’s go ahead and learn about the installation process.

Enable the Linux Bash Shell on Windows 10

The steps to enable the Linux Bash Shell on Windows 10 are quite simple and straightforward. All you have to do is enable certain features on Windows 10 and download your choice of Linux distribution from Microsoft Store. That’s it. So let’s go through the steps in detail without any delay.

1. First of all, we need to enable the “Windows Subsystem for Linux” feature. To do so, press the Windows key once and type “windows features”. After that, click on “Turn Windows features on or off”.

How to Enable the Linux Bash Shell on Windows 10 [WSL 2] 6

2. Next, scroll down and enable “Windows Subsystem for Linux”. Now, restart your computer to reflect the changes.

Enable the Linux Bash Shell on Windows 10

3. After reboot, open Microsoft Store and search for “Linux”. You will find many distributions of Linux including Ubuntu and Kali Linux. For this article, I have chosen Ubuntu as it’s more popular among general users. Now, click on the “Install” button.

Enable the Linux Bash Shell on Windows 10

4. After the installation is done, restart your computer again for the changes to take effect. Now, simply search for “Ubuntu” in the Start Menu and open it.

Enable the Linux Bash Shell on Windows 10

5. For a few seconds, it will show “installing….” and after that, you can set your UNIX username and password. Voila, the Linux Terminal is ready to use!

Enable the Linux Bash Shell on Windows 10

6. Here is the Linux Bash Shell in action on Windows 10. I am able to use many of the Linux commands and it works flawlessly. You can even upgrade to the latest build of Linux by executing sudo apt upgrade command.

Enable the Linux Bash Shell on Windows 10

How to Upgrade Windows Subsystem for Linux (WSL 1) to WSL 2

If your PC is enrolled in the Windows Insider program and is updated to 18917 or above build then you can upgrade to the latest WSL 2. It comes with significant performance improvement which I have talked about in detail in the next section. So, let’s go ahead and learn how to upgrade from WSL 1 to WSL 2.

1. Before moving to WSL 2, we need to enable another Windows Feature. Similar to what we did in the first step of the above section, search for “windows features” again and open it. Now, scroll down and enable the “Virtual Machine Platform” feature. Finally, restart your computer.

How to Upgrade Windows Subsystem for Linux (WSL 1) to WSL 2

2. Next, open PowerShell with administrator privilege and execute the below command. Make sure to replace <Distro> with the installed distribution name like Ubuntu, Debian or Kali Linux. Now, your PC will start converting WSL 1 to WSL 2. It will hardly take 5-10 minutes.

wsl --set-version <Distro> 2

How to Upgrade Windows Subsystem for Linux (WSL 1) to WSL 2

3. Now, enter the below command in PowerShell to check the current version of the Windows Subsystem for Linux. It should now show version 2. Awesome, you have successfully moved to WSL 2!

wsl -l -v

How to Upgrade Windows Subsystem for Linux (WSL 1) to WSL 2

How is WSL 2 better than WSL 1?

With the release of WSL 2, you can do much more on Windows 10 since it comes with a real Linux kernel. It takes almost 20x less time than WSL 1 to fetch I/O commands and compile programs which are huge improvements. The WSL 1 was shipped with a Linux kernel compatibility layer that took significantly more time to decompile commands and answer system calls. Also, there was limited command support on WSL 1 which has now been replaced by full support with WSL 2. Basically, for serious programmers and students, it’s a boon having Windows and full Linux support side by side.

Here is an example of how fast and efficient WSL 2 is in comparison to WSL 1. The latest WSL 2 took 4.09 seconds to transfer Google’s homepage in comparison to WSL 1’s 11.64 seconds. You are saving 3x less time which is of huge significance in programming and software development.

How to Upgrade Windows Subsystem for Linux (WSL 1) to WSL 2

Since WSL 2 is now packed with the actual Kernels and Linux apps, you can also run the Ubuntu GUI. However, it’s not supported natively and we will have to wait for Microsoft to implement this awesome feature. As of now, there are a few third-party ways to run the GUI using the Hyper-V virtualization feature on Windows 10, but the process is too complex for an average user to go into. So, as and when WSL 2 is released with native support for GUI, we will surely let you know complete steps.

Here is a brief timeline of the WSL 2 release date.

  • Windows Insider– June 2019 [Already live, Build 18917 or above]
  • Public Release — Q1 2020

Use Linux Bash Shell with WSL 2 Support in Windows Terminal

Now, after the Windows Insider September release, you can use Bash Shell along with PowerShell and Command Prompt side by side on Windows Terminal. And the great part is that it supports the latest WSL 2. No need to convert the distro every single time. You can just open the Windows Terminal and click on the “down-arrow” button and select “Ubuntu”. That’s it. Enjoy!

Use Linux Bash Shell with WSL 2 Support in Windows Terminal

Make Windows 10 Your Next Workstation with Full Linux Support

So that was our detailed look into Windows Subsystem for Linux and how you can enable the Linux Bash Shell with WSL 2 support on Windows 10. It’s amazing how Microsoft is showing its commitment to bring full-fledged Linux support on Windows 10. Clearly, Microsoft is trying to make Windows 10 a universal platform for everyone including average users, developers and of course, students. Anyway, that is all from us. If you found the article informative and want to see similar posts on the new Windows-Linux ecosystem then stay tuned with us. We will be bringing more in-depth guides and tutorials in the future.

Comments 3
Leave a Reply

Loading comments...