Open-Source Development on the Windows Subsystem for Linux

Nolan Lawson
Offline Camp
Published in
3 min readMar 27, 2018

As someone who recently started using Windows but came from a Mac and Linux background, the Windows Subsystem for Linux has been a bit of a game-changer. Especially when working on open-source software in the JavaScript, Ruby, and Python communities, it can come in quite handy.

The main problem that the Windows Subsystem for Linux (aka WSL) aims to solve is compatibility. Anyone who has developed command-line interface (CLI) tools and tried to make them work properly across Linux, Mac, and Windows has undoubtedly run into issues with environment variables, backslashes versus forward slashes, and so on. The standard Windows terminals (including cmd.exe and PowerShell) are just very different from the terminals found on Unix-like systems such as Linux, Mac, and BSD.

In the Node.js world, tools like cross-env and path are helpful, but it’s still easy to slip up if your main dev box is Mac or Linux, and you’re not regularly testing on Windows. This can limit the reach of your CLI tool, or even who is able to contribute to it, especially given that Windows constitutes over 80% of desktop OS share.

Enter WSL, which aims to build a Linux-like layer on top of Windows. It interfaces directly with the Windows filesystem and executables, while still presenting an API surface that “looks” like standard Linux. Therefore, most tools designed with Linux, Mac, or BSD in mind should “just work” on WSL.

Linux on the Microsoft Store? Yes, truth is stranger than fiction.

When it was first released, I found compatibility of WSL (then commonly known as “Bash on Windows”) to be a bit spotty. After the Fall Creators Update in late 2017, though, I found that most of my standard Node, Ruby, and Python tools really did “just work” with minimal fuss.

Today, you can install various flavors of Linux from the Microsoft Store, and even run them side-by-side. Currently, Ubuntu, openSUSE, Kali Linux, and Debian are all available, with Fedora coming soon.

Multiple Linux distros can be installed side-by-side

At Offline Camp Oregon last year, I was representing not only the PouchDB and Mastodon open-source communities, but also Microsoft as a sponsor. So I had a chance to show off my dev laptop running Windows, and to explain how I customize my WSL experience to make open-source development of offline and decentralized technologies like PouchDB and Mastodon easier.

Nolan Lawson introduces us to the Windows Subsystem for Linux at Offline Camp Oregon, November 2017

Since multiple folks asked about this after the talk, my terminal customizations are:

  1. ColorTool using the OneHalfDark theme.
  2. tmux for tab management.
  3. A silly .bash_profile script to print a dancing Kirby on every input. (These kinds of things are very important to me!)
Kirby showing off his dance moves in the terminal

If you run into any compatibility issues with the Windows Subsystem for Linux, be sure to file an issue on the WSL GitHub repo. Rich Turner and the rest of the WSL team are very keen to get feedback and to keep improving on compatibility!

Editor’s Note: Participants at Offline Camp Oregon had diverse backgrounds and interests, ranging far beyond the Offline First approach that we came together to discuss. Through short passion talks, campers shared with us some of the hobbies, projects, and technologies that excite them. We’re sharing a taste of that passion with you here as a preview to our upcoming events.

--

--