The Windows Sub-System for Linux (WSL)

The Windows Sub-System for Linux (WSL) is in interesting development from Microsoft which historically has been anti Linux in the past years. Most notably Steve Ballmer (Ex Microsoft CEO) has called the project “cancer” but now Microsoft embraces the Linux project as a major component to its could hosting product Azure.

Recently Microsoft has opened Windows and allowed the Linux penguin to step inside. The WSL was made possible through an interface which maps system calls between the Windows & Linux kernels. This allows Linux based software to run & compile on Windows computers without using any virtualisation or other methods of operation. The current implementation is limited to only the command line applications as the process does not support any display servers to render the Linux desktop GUI (Ubuntu, Fedora, etc) or graphics applications.

The WSL implementation includes mapping for most of the important functionality such as networking, and the local filesystem. This allows the Linux system to access documents on your C:// drive, portable storage such as USBs or remote files.

As we know, Linux is simply the kernel or a portion of a modern operating system. To use the feature on your Windows computer, you must install a Linux distro from the Microsoft Store. Most of the common distros are available to install such as Ubuntu, OpenSUSE, Fedora, SLES and many others. Microsoft & Ubuntu’s Canonical have taken an extra step to enable programmers the best possible work environment by creating a linking interface to Visual Studio Code from the Ubuntu side to the Windows installed VS Code. This enables greater control & development options for those who run & deploy code on Linux machines/servers but prefer to write the application on Windows.

I personally use WSL for web development, this includes writing Python backends using PIP & JS frontends using NPM. The Git version control works out of the box & creating the public/private key for SSH & Git was easy. I have noticed any keys created on the Windows side is not available on the Linux side, so you must create a second key pair if you choose to connect to remote machines from WSL.

Running Ubuntu WSL from the stock terminal window is a pain as any new terminals are opened in a new instance & window. I recommend everyone to download and use the new terminal provided by Microsoft simply called “Terminal” found on the Microsoft Store. The terminal app allows you to open CMD, PowerShell & WSL windows all as tabs within the single window, such as the terminals in most Linux distros & Apple Mac computers.

Before enabling the WSL feature, I recommend you update your computer to the latest stable Windows 10 build. To enable WSL, you must open the Windows additional features control panel and tick the Windows Sub-System for Linux option, & then reboot the computer in typical Windows fashion. Once rebooted, open the Microsoft Store application and download your favourite Linux distro. After installation is complete, simply open the newly installed program. The Linux distro on initial start my prompt you to choose a username and/or password.

Microsoft has really been doing well lately with Linux and opensource software, but it still refuses to support the project with its main money-making apps such as the Office suite but interestingly has chosen to support the new Microsoft communications program Teams on Linux.

Leave a Reply

Your email address will not be published. Required fields are marked *