Skip to main content

Windows Subsystem for Linux

I have been using the Linux subsystem on Windows for a while now and I am quite thrilled about it. I do think that this is something everyone who is doing development on a Windows computer should set up.

What the Windows Subsystem for Linux is (and what it isn’t)

For a few years now, thanks to Windows 10, it has been possible to have a Linux subsystem available on your Windows operating system (often referred to as WSL). It is important to note that this just exposes a shell - you are still regularly interacting with Windows. Effectively, you just have an app that launches a Linux terminal. There is therefore no way to use graphical Linux tools such as video software and the Linux subsystem is also not a virtual machine.

The Linux subsystem in action

Why would you want to use it? At work, I am using a Mac which is a UNIX operating system just like Linux. At least in my line of work (web development, testing and DevOps) developing on Linux is extremely common because this is usually the target operating system on which our programs run. Furthermore, there are a lot of command-line tools out there for Linux which don’t have a Windows equivalent. And even if these exist, it is simply nicer to work with the tools one already knows. This goes especially for scripting: bash/sh is a powerful scripting language and I have gotten quite good at it over the years - the same can not be said about my scripting skills with Windows and .bat files. I have a few projects (like my website) where I wrote node.js scripts to automate build tasks just because I couldn’t use bash and struggled with .bat files.

Yes, I could have a second operating system on my computer which would eliminate the need for a subsystem - but this comes with a different set of problems. In fact, I do have an installation of elementary OS on my computer and have dabbled with it for years but never managed to iron out the problems. The biggest hurdle is that I have a widescreen monitor but a very old graphics card. Getting Linux to display in full widescreen format is a task I could not achieve even after days of configuration - and judging from the hundreds of forum posts out there I am not alone with this.

My Windows dependent situation is amplified by the fact that my eyes need the app f.lux which takes away the eye-straining blue light elements. There is also a Linux version but it is far inferior to the Windows and Mac pendants. The final nail in the coffin was that I have an extensive set of AutoHotkey scripts to automate dozens of tasks with keyboard shortcuts - which is Windows only. On top of that, in order to switch operating systems while booting, I have to activate the BIOS mode on my Corsair keyboard as it otherwise only works once the keyboard driver installed on the operating system kicks in.

Installation and Setup

Installing the subsystem was relatively easy, there is a comprehensive guide on the Microsoft website. The word “relative” should be pointed out here as it is not as easy as installing let’s say a web browser - but hey, you are diving into the world of Linux. Get used to pain! Once you have the subsystem installed, you will have an app called “Ubuntu” available in your start menu which opens a Linux shell. All the standard shell commands work there, such as uname -r which shows the name of the Linux installation. In my case, this is 4.4.0-19041-Microsoft.

$ uname -r
4.4.0-19041-Microsoft

By default, the standard Ubuntu shell is rather unpleasing, both visually as well as functionally. Therefore your next first step should be to install zsh. I found a wonderful article by Joao Grassi which goes into great detail on how to set it up. An important step here is to use the Windows application ConEmu which is the Windows equivalent to iTerm2 - a comfortable shell window manager which many features such as splitting windows.

Usage and Development

Let’s get to the fun bit - developing with Linux on your Windows machine. Installing programming languages and tools works like on Ubuntu - don’t forget, you are using Ubuntu now! Thus, there is a lot of apt-get involved as well as downloading tools via curl and moving them into /usr/bin (or adding them to the $PATH variable on each shell start). This is quite pleasant since most tutorials and Getting Started guides are usually written for UNIX systems. I’m sure every Windows developer has been in a situation at least once where things errored on installing - no such problems with WSL.

While you are in the Linux subsystem, you have access to all the files on your Windows computer using the /mnt directory. For example, my Windows directory C:\code can be accessed from within the Linux subsystem on /mnt/c/code.

I have all my programming languages installed in WSL but some of these I also have installed on Windows, i.e. Golang. This is extremely useful because that way I can compile programs both for Linux and for Windows on the same computer.

Visual Studio Code for Windows Linux Subsystems

Having a separate Linux shell is great but you don’t want to do everything in the terminal, especially when it comes to writing code. Sure, some people love vim but most of us are probably dependent on actual text editors and IDEs. This is where Visual Studio Code comes heroically to the rescue with its incredible Remote WSL extension. Once this extension is installed, you can launch Visual Studio Code on Windows like you usually would - but VSCode will run on your Linux subsystem!

This icon shows you that VSCode is running inside the Linux subsystem on Windows

The important point here is that the entire process of VSCode will run on the Linux subsystem. What this means in action: For example, when you are installing language formatters such as for Golang, these will go into your Linux subshell. For me, this is ground-breaking because it means that I can for the first time comfortably develop in Golang using Visual Studio Code. Many of the tools used by the Golang VSCode extension did not work properly on Windows. For years, I was reluctantly living with these problems. But now when using Linux, these formatters and tools suddenly all work as they should. It’s incredible.


In summary, the Windows subsystem for Linux is a fantastic addition that should be a strong consideration of every Windows developer’s toolchain. While the setup process is not easy, it is worth it. My prediction is that it will find a wide adoption over the next few years and will only advance the strong position UNIX operating systems have in the development community.