Why Windows Subsystem for Linux is Good for Developers

Windows developer team has been releasing the WSL also known as the Windows Subsystem for Linux since Windows 10- 1903 build version. Team launched first version of the WSL that allows you to run Linux instance on your Windows.

First time I tested it out, I managed to run small Ubuntu server instance within my laptop. Though you may not find much out of such small instance unless you are developer. But for me under 8GB RAM. I had no option other than installing the command line version of the ubuntu server.

Take a look at my instance of Ubuntu 20.04 LTS server installed in Windows 10 laptop.

desk.jpg

Image Credit: my desktop with WSL Ubuntu

How to setup WSL on Windows?

In order to run WSL on your windows computer. You have to make sure to follow the steps.

  • Go to Settings > Apps & features in Apps page.
  • From here turn windows feature on or off in dialog box.
  • Check the box for the Windows subsystem for Linux.

This method woks for the WSL 1. And now for the new update of the WSL. Windows 10 ships this WSL 2 update with the Windows 2004 and soon it will be in 2010h2 as well. You have to run the following command in your powershell core window.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

That's it. Now you can go to Windows store. And then choose various command line Linux versions that you can install and use inside the Windows desktop. Microsoft store has plenty of options for you to choose from.

lin.jpg

Image Credit: My desktop screenshot of Microsoft Store

Now that you know how to install Install command line Linux inside the Windows. You may ask yourself, why bother? What are some of the things you can do with it?

Let's see things you can do with the WSL Linux installs.

Less CPU and RAM
When you install the server edition of these Linux distros. You are going to use less CPU and RAM. Take example of the Ubuntu 20.04 LTS installed instance. I have one laptop with 4GB RAM and this instance works just fine like another window of the command prompt.

Ruby
Note: This could be my personal experience but the thing is that performance of ruby from installer to working with gems is horror.

Ruby programming language is pretty popular among the developers. But on Windows, there are countless number of bugs that you would face while trying to install gems, fixing certification errors for gems and fixing a lot of things just to get the ruby working. Now you can install ruby through this installed Linux. No more those bugs and the countless errors which nobody on github bothers fixing.

A lot of languages installers and the tools perform lot better on Linux than on Windows.

Local Testing
Do you have VPS account where you upload your website files or work with other apps? You can test out all of that local first before you upload to your server. You can also test out the docker and the vagrant images locally too. You can also test some of the command line apps you made for Linux through this install.

Command Line Tools
Linux has tons of command line tools that can improve your workflow. Something you may not do easily with the Powershell or you are forced to remember long commands with the Powershell. I document a lot of command line tools on Twitter.

Take example of disk usage tool

You can also run some of the Linux based apps which have command line support. Using it from the command line you can do certain operations lot quicker too instead of using gui apps which consume more RAM.

Should you use it?
I think at the end of the day, it comes down to personal preference. But most of the developers who want to use Linux based tools can make use of WSL Linux instance on Windows 10. I don't think every developer needs to use WSL unless they need Linux support in one way or the another.

Have you used WSL or have improved your Windows workflow in any way with it?

H2
H3
H4
3 columns
2 columns
1 column
1 Comment
Ecency