Windows Subsystem for Linux – A High Level Overview

Author by Scott Poling

I would like to start out this overview by saying that this is something very exciting Microsoft has released here. You can now run Linux command-line tools directly on windows, without use of Virtualization applications. It has been out for a year or so now, but it has just recently left beta. The Windows Subsystem for Linux (WSL) could arguably be known as a form of virtualization.  I want to preface by saying this is not for deployment of any kind. You can likely run Apache Web Server under WSL, and it might be helpful to use for development but the intent is to not use this for production deployment.

WSL was the product of Project Astoria, which is the effort to run android apps on Windows 10 Mobile. WSL does not allow the use of graphical subsystem. It will only work for command line applications. Ruby and Python devs should be very happy with this news. I will touch later why I feel this is a bigger deal for Microsoft than perceived, but let’s get started with using this!

Firstly, Your PC must be running a 64-bit version of Windows 10 Anniversary Update or later (build 1607+). You then need to turn Developer mode ON. I will say that it is probably recommended to not keep developer mode on.
  1. Open PowerShell as Administrator and run:
  1. Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  1. Restart your computer when prompted.
If you are a Windows Insider, you can install your favorite Linux distro (OpenSUSE, SLES, etc)
After you’ve done this, open the command prompt in admin mode and type bash
Your UNIX credentials have no relation to your windows username and password.
Avoid creating and/or modifying files in %localappdata%\lxss\ using Windows tools and apps! If you do, it is likely that your Linux files will be corrupted and data loss may occur. Avoid this issue by using a directory located under /mnt/.
Afterwards, all you need to do is type bash in CMD and you are off to your Linux environment.

While these tools are not inherently useful when working with companies that are running full Microsoft stacks, it is useful when stacks include OSS projects. You can even drop into bash from Powershell.

Stepping back, I think that this is a great thing for Windows. Windows is trying to win back the development market, especially with OSS projects like node.js and others being not exactly targeted for development on a Windows based platform. For developers this means that you can run GIT without a 3rd party tool like Cygwin or the others, which tend to be slower and none of them support Linux ELF Binaries. Since this was talked about a year ago, it has finally left beta, and there is growing support for this. You can even theme your bash window like Ubuntu.

There have been plenty of software suites that have not been as ‘successful’ as their counterparts (even if the less successful suite could be considered better) due to limitations on proprietary rights. Take PostgreSQL vs MySQL for example. I would consider Postgres to be an all-around better database than MySQL, however people were more hesitant to use it due to OS limitations. Running it on Windows was more tasking than the very user-friendly MySQL Windows installer.

I am very excited for what this means for open source and Microsoft, as well as the current and future doors this can open. This may just finally be the push for Windows to become the developer tool of choice, over Apple. 
Tags in this Article