August 8, 2017 10:12 am

Windows Subsystem for Linux on Windows Server

The Windows Subsystem for Linux (WSL) is available in Windows Insider builds of Windows Server. Now developers and application administrators can run tools they use in Linux environments alongside Cmd and PowerShell.

If you want to jump straight in, the installation guide is available here.

Why include WSL on Windows Server?

We want Windows, including Windows Server, to be a great place for developers. We know developers, system administrators, people managing services and people building services all occasionally need tools available on Linux.  Many more would like to run Linux tools as part of their workflow as a matter of convenience.

Previously, there were a few options:

  1. Run something like Cygwin and rely on Win32 ports of common GNU tools.
    Cygwin is a great toolset but it runs into issues when using tools that haven’t been ported to Windows. Many tools simply aren’t available. This is especially common when trying to build and run Ruby & Java solutions, which utilize some Linux-only Gems, libraries and components.
    The tools available through Cygwin and other Win32 ports are also notorious for being out of date – which is understandable since updating them requires recompiling them for Windows. For Windows users, however, this is both inconvenient and often leads to troublesome compatibility issues when running, building or deploying software.
  2. Use Linux in a virtual machine.
    Virtual machines are designed for production workloads on Windows Server. They aren’t ideal for things closely tied to the Windows Server host. If you need basic Linux command-line tools integrated with their Windows system, a virtual machine will be cumbersome.

This is where running Linux on WSL provides value: WSL runs unmodified Linux (ELF64) binaries natively. It can install and run almost any Linux command-line tool integrated in Windows.

With the additions of WSL and Linux containers with Hyper-V isolation, Windows Server offers a wide variety of Linux options that make it a great place and platform for modern developers.

If you’re a server engineer that needs to run node.js, Ruby, Python, Perl, Bash scripts or other tools that expect Linux behaviors, environment or filesystem-layout, the ability to install and run Linux with WSL expands the tools at your disposal on Windows Server.

What this isn’t — WSL is not a Linux server

Just as with WSL on Windows Client, you can run daemons and jobs like MySQL, PostgreSQL, sshd, etc., via an interactive shell, but you cannot currently use WSL to run persistent Linux services, daemons, jobs, etc. as background tasks.

For these sorts or tools, read more about Linux containers with Hyper-V isolation from the Build 2017 announcement.

How do I get started using WSL on Server?

Windows Subsystem for Linux arrived in Windows Server Insider Build 16237. Follow our new Windows Server WSL Installation Instructions to get started running Linux alongside Cmd and PowerShell on your Servers.

Feel free to comment below or reach out to Sarah and Rich via Twitter.

Updated June 1, 2018 9:25 am

Join the conversation

  1. Hi,
    When can we expect WSL to be available on Windows Server 2016 with Desktop Experience?
    Thank you,
    Emil

    • Hey Emil.

      Remember that Insiders builds are ~weekly snapshots of the next version of Windows as it’s being built. Thus, current Server Insiders builds are weekly snapshots of the next version of Windows Server. Details on release dates, etc. of the next version of Server should be available soon.

  2. This is a good first step, but we really *do* want to run Linux system software as persistent services. Until that feature is available, WSL on Windows Server is merely a neato toy. On the desktop, sure; I use WSL as my go-to command line, having grown up in a unix world, it makes Windows desktop far more usable than cmd or powershell. On a server, not so much.

    Wouldn’t it be great to have Windows Server run both Windows and Linux containers simultaneously without the need for a bunch of weird helper-VMs? Wouldn’t it be great to make the vast catalog of Linux system software installable on Windows Server in a production environment? None of this is really doable unless WSL can be invoked from the Service Control Manager.

    Please consider adding this very important and potentially very useful feature.

    • Hi Art.

      WSL was not designed for, and is not recommended for running persistent Linux system software.
      WSL is a convenience toolset, initially aimed at developers, to make it easier to build, test, and run tools and projects that require a Linux environment and/or tools/binaries. It turns out that sys-admins, ITPro’s, dev-ops specialists also run and enjoy WSL. So much so, that we had A LOT of asks for WSL to be made available on Windows server for admin, build, test, deployment, etc. purposes.

      Interestingly, after we wrote this this post, continued improvements to WSL mean that you CAN now run daemons, etc. in the background, even after you’ve closed a distro’s last open Linux Console. However, this is a developer/admin convenience, not an opportunity to run your production MySQL/Postgres/nginx/Apache/etc. services on WSL – that’s something you’ll want to look at Hyper-V & Containers for.

      To your second point re. running Windows and Linux containers simultaneously: This is precisely what Linux Containers On WIndows (LCOW) is for: https://blog.docker.com/2017/11/docker-for-windows-17-11/.

      To your latter point: Again, WSL is not we’ll suited to running production workloads – this is something that Containers (esp. LCOW) and VM’s are specifically built for.

      We continue to explore new and innovative ways to bridge the Windows and *NIX worlds, helping bring them closer together and run side-by-side on the same machine. Stay tuned for lots more exciting news in this area!

      • I understand that WSL was not designed for this job, and currently may not be capable to run Linux daemons on Windows as services, but as you’ve said, it’s a great tool which has gained the attention of many sysadmins.

        Getting a secured remote shell on Windows is a cumbersome task. Many decide to use RDP as an alternative and open CMD in a GUI environment, which I find inefficient. Instead, for the past three years, I’ve been running SSHD through Cygwin to get a decent shell on both my own Windows 10 PC and the Windows Server 2008/2016 which I manage at my company.

        Hearing about WSL was and has been great news to me, so I’m really excited for a day to see it being able to provide stable background tasks on production servers, as well as its main job which is to provide POSIX-compliant development environments.

        All in all, I appreciate the work you all do at Microsoft to bring the open technologies into the Windows ecosystem.

        Have a great day!

        P.S. I noticed there’s a misspelling in your article, where “Cygwin” the second time is mistyped as “Cigwin”.