Hands-On with WSL: More Apps, Exciting Features
The fifth and final article of a five-part series on Microsoft's Windows Subsystem for Linux (WSL).
The Windows Subsystem for Linux (WSL) is a powerful addition to Windows 10, and if you're relatively new to the topic, be sure to check out my four previous articles: in the first I gave an overview of how to install it; in the second, I went over some of its basic uses; in the third, I discussed how to use other Linux Distributions with it; in the fourth, I dove a little deeper and explained how to push it beyond what it was designed for. In this current and final article of my WSL series, I'll first look at some additional applications that have been known to work with WSL, and then I'll discuss two exciting features in the upcoming WSL release.
Additional Apps Known to Work with WSL
Another interesting thing that you can do with WSL is launch Windows binaries from it. For example, you can launch a Windows command-line window from WSL by typing in cmd.exe from the WSL window. To test this, I entered ver from the window, which failed. I then entered cmd.exe, which placed me in the windows command-line shell. I entered ver again, and it correctly reported the version of Windows that I was running. Interestingly, I found that if I typed winver, it would only pop up after I exited the cmd (see Figure 1).
Conversely, you can also run WSL commands from a Windows console by prefacing the command with wsl. To test this, I brought up a Windows console and typed in the Linux command ls to list the files in the current directory, which failed. When I prefaced ls with wsl, however, it then listed the files in the directory. I then typed in wsl ls | wc -l to get the number of lines being displayed, which failed; however, once I typed wsl ls | wsl wc -l, it completed successfully (see Figure 2).
Upcoming WSL Features
As a quick disclaimer: I drew my information here from various sources, but, as with all unreleased software, this information may and probably will change with the final release of the product. The next release of Windows 10 will be 1803 (code-named "Redstone 4" or "Spring Creators Update"), which is scheduled for release in early 2018.
The enhancement I'm probably most excited about in a future release of WSL is that it will be able to run background processes after all the console windows have been closed. This means that cron, sshd and httpd will be able to remain idle and wait to be used without having to have a WSL console window opened. However, you'll still need to write your own scripts if you want to run tasks on startup (init, system, cloud init and so on).
The second upcoming feature that I'm looking forward to is wslpath, a tool that allows you to convert a Linux path to its Windows equivalent. Yeah, I know that seems super simple, but it's painful to constantly convert from one path format to another, so I welcome this new feature with open arms.
WSL is an interesting tool that you can use to increase the usefulness of your Windows 10 desktop. Throughout this series of articles, I showed you how easy it is to enable WSL on a Windows 10 system, how to use it, how to easily identify which Linux commands, programs and applications work with it, and how to run it from the Windows command. Yes, it still has some rough edges, but it's still being actively developed by Microsoft and should improve over time; overall, WSL is quite a useful tool to have on your Windows desktop.
Tom Fenton has a wealth of hands-on IT experience gained over the past 30 years in a variety of technologies, with the past 20 years focusing on virtualization and storage. He currently works as a Technical Marketing Manager for ControlUp. He previously worked at VMware in Staff and Senior level positions. 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 X @vDoppler.