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 andacquiredthe popular code-management platform, GitHub. On similar lines, Microsoftjoined the Linux Foundationas 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 aprogrammer, I will show how you can enable theLinux Bash Shellon 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

Enable the Linux Bash Shell on Windows 10

The steps toenable the Linux Bash Shellon Windows 10 arequite simple and straightforward.All you have to do is enable certain features on Windows 10 and download your choice ofLinux distributionfrom 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”.

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

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

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

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

  6. Here isthe Linux Bash Shell in action on Windows 10. I am able to use many of theLinux commandsand it works flawlessly. You can even upgrade to the latest build of Linux by executingsudo apt upgradecommand.

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

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

If your PC is enrolled in the Windows Insider program and isupdated to 18917 or above buildthen 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 anotherWindows 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 andenable the “Virtual Machine Platform” feature. Finally, restart your computer.

  2. Next,open PowerShell with administrator privilegeand execute the below command. Make sure to replacewith the installed distribution name likeUbuntu,DebianorKali Linux. Now, your PC will start converting WSL 1 to WSL 2. It will hardly take 5-10 minutes.

  3. Now,enter the below command in PowerShellto check the current version of the Windows Subsystem forLinux. It should now show version 2. Awesome, you have successfully moved 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 sinceit 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. TheWSL 1 was shipped with a Linux kernel compatibility layerthat 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 latestWSL 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.

Since WSL 2 is now packed with the actual Kernels andLinux 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 theHyper-V virtualizationfeature on Windows 10, butthe 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 theWSL 2 release date.

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 sideonWindows 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!

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.

Arjun Sha

Passionate about Windows, ChromeOS, Android, security and privacy issues. Have a penchant to solve everyday computing problems.

Add new comment

Name

Email ID

Δ

01

02

03

04

05