Windows Subsystem for Linux

Windows Susbsystem for Linux (WSL) provides a means of running Linux natively on Windows.

It’s not often that I get excited about the release of a new Windows update, but it’s fair to say the Windows 10 Anniversary Update, which includes a new Windows feature called “Windows Subsystem for Linux” has done just that.

So what is the Windows Subsystem for Linux? Well, it provides a means of running Linux natively on Windows. Or more accurately, quoting Wikipedia:

Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. [...] WSL provides a Linux-compatible kernel interface developed by Microsoft (containing no Linux code), with user-mode binaries from Ubuntu running on top of it.

WSL has the potential to change how we work on Windows. We and no doubt many others use emulators/ports to allow us to use tools such as Git and Bash on Windows for our web development work. WSL has the potential to allow us to remove that extra layer and instead use Linux tools natively on Windows, using the exact same binary executables (no emulation here).

It’s still early days and WSL is still in beta, so it wasn’t long before I hit a bug in my own testing that prevented our Gulp build script from running. But rest assured once the bugs are ironed out WSL has real potential to make web development on Windows even better.  The bug that I'm waiting on has just changed to "Under Review", so it seems Microsoft are actively working on resolving the pain points.

Anything that enables us to achieve a development environment that’s closer to what we’re using in production is always an advantage.

Here are some handy links:

A few gotchas/notes:

  • The Windows 10 Annniversary Update can take up to 90 minutes to install.
  • Don't try editing the home directory files from Windows, do so from WSL.  If you do the files will likely dissapear from WSL.
  • If you want to find the home directory the files are here: "C:\Users\<Windows username>\AppData\Local\lxss\home\<WSL username>" bear in mind the "lxss" folder is hidden so you might need to enter the path rather than navigate to it via Windows Explorer.
  • You can update WSL by running the usual "apt-get update" and "apt-get upgrade".

You might also like...

Brotli compression

Michael Walsh by Michael Walsh