Using the Windows Subsystem for Linux

Muzammel Hoque
Sitback

--

The Windows Subsystem for Linux is an excellent addition to Windows. For a long time now, MacOS has been dominating because it was providing the Linux terminal in a friendly GUI. It has been allowing us the devs to efficiently utilise both GUI and Terminal without needing to dual boot. But with WSL becoming stable, we are no longer dependent upon MacOS.

— Thank you, Microsoft.

But with a new system, there is always some teething issue and some learning curve. If you are looking to install WSL, below is an excellent article from MS on how to achieve it -

https://docs.microsoft.com/en-us/windows/wsl/install-win10

A quick note — after installing a second Linux App you might find that your new app is not triggering from the terminal. For example, if you enabled WSL & installed Ubuntu before installing the 18.04 LTS, the ubutnu1804 command might not work for you after installing the Ubuntu 18.04 LTS app. You will most probably get an error similar to below:

“ubuntu1804 is not recognised as an internal or external command, operable program or batch file.”

And to add to the confusion, if you open your terminal using elevated privileges the ubuntu1804 command might work. The reason is, in the non-privileged mode, it has the first install set as the default. If you run “wslconfig /l”, it will list the available installs and which one is the default. You can change the default using “wslconfig /s name_of_the_app_from_listing”, and after that, the wsl command will open the one that you have set as default. For ubuntu distro, you can run “lsb_release -a” command to check the version.

One last thing I would recommend is to consider using Hyper instead of the default command line terminal — https://hyper.is/

Hopefully, this will save some time!

--

--