Hands-On with WSL: Installing Windows Subsystem for Linux on Windows Server
The recent release of Windows Server 2016 version 1803 allows WSL to be installed on it. Tom Fenton steps you through the process.
Windows Subsystem for Linux (WSL) has been available for Windows 10 since 2017, and in a previous article I showed you how to install WSL on Windows 10. The recent release of Windows Server 2016 version 1803 (released April 30, 2018) allows WSL to be installed on it, and in this article I'll show you how.
Although WSL is now available for Windows Server, getting a build of Windows that supports WSL can be challenging as the only production versions of Windows Server that are currently available to most users are pre-1803 builds (Figure 1). In order to get a version of Windows Server that supports WSL, you need to be either running a Windows Insider Program for Business or using a Semi-Annual Channel build, which is only available to Software Assurance or Microsoft Cloud customers.
I used my Windows Insider Account to download Windows Server Insider preview build 17650, and installed it as a virtual machine (VM) with 2 vCPUs and 8GB of RAM on vSphere 6.5. After Windows Server was installed, I verified that I was running a version of it that supports WSL by entering winver from the command line. Figure 2 shows the results.
Like many other features, WSL can be installed from the Server Manager. To do this, bring up the Server Manager, then take the following steps: select Add roles or features, select Role-based or feature-based installation, select your local server and then click Next on the Select Server Roles page. On the Select features page select Windows Subsystem for Linux (Figure 3) and, finally, on the confirmation page click Install. I had to restart my system after WSL had finished installing.
After restarting my server, I logged back in and entered WSL on the command prompt and was informed that WSL was working but no Linux distributions were installed (Figure 4). It instructed me to go to https://aka.ms/wslstore; however, this message appears to be an error as this Web site does not exist. Alternatively, I was able to enter https://aka.ms/wsl-ubuntu-1604 on my Web browser and download Ubuntu for WSL. If you want to download OpenSuse, use the URL https://aka.ms/wsl-opensuse-42, and for SLES 12, use the URL https://aka.ms/wsl-sles-12.
Once the Ubuntu file was downloaded, I extracted it and double clicked ubuntu; when presented with a dialog indicating Windows Defender SmartScreen prevented an unrecognized app from starting, I clicked Run anyway (Figure 5). It took few minutes to install, and I was then presented with a prompt to enter a user and set the user's password (Figure 6).
Once Ubuntu had finished installing and I had created a user, I could then enter wsl on the command prompt and use the WSL bash shell to perform various functions. To see some of the things that you can do with WSL, be sure to read my articles about executing daily tasks, running graphical apps and other features and apps that work with WSL.
Tom Fenton has a wealth of hands-on IT experience gained over the past 25 years in a variety of technologies, with the past 15 years focusing on virtualization and storage. He currently works as a Technical Marketing Manager for ControlUp. He previously worked at VMware as a Senior Course Developer, Solutions Engineer, and in the Competitive Marketing group. He has also worked as a Senior Validation Engineer with The Taneja Group, where he headed the Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on Twitter @vDoppler.