Today at Microsoft’s Build developer conference, the Redmond company announced some major changes to the Windows Subsystem for Linux, as well as some improvements to Windows 10 command line with the Windows Terminal. Both expand the already robust ways to develop on Windows, and offer some fantastic features and additions.
Windows Subsystem for Linux has evolved dramatically since it was first introduced as a Bash shell back in the Windows 10 Anniversary Update in 2016. Windows Subsystem for Linux, or WSL, offered native support for Linux by translating Linux system calls into Windows APIs that could be executed by Windows itself, and the feature allowed developers that required Linux to install a distro of their choice and access its command line side by side with Windows.
While the translation layer added compatibility and ease of use, one area where it could stumble would be performance, so for Microsoft’s second iteration of WSL, Microsoft is adding a custom Linux kernel to Windows itself to handle to Linux APIs. It is doing this through virtualization, with Linux running in a lightweight Hyper-V Virtual Machine (VM) that is tightly integrated into Windows, which will allow for full system call compatibility because the Linux kernel will be responding to requests, rather than having them translated.
Although this is a VM, there will be no resources to configure, and launching a shell will only take a couple of seconds to get up and running. It’ll still be able to access the Windows file system to retrieve and modify files, just like WSL v1, but also provide the capabilities to run most Linux software, such as X-Server, Docker, and more, right in Windows. As a VM, it’ll have its own network card, although it’ll be set by default to be shared with the physical NIC in the host PC for now, although that may be changed prior to WSL v2 being formally released.
The Linux kernel itself will be a custom-compiled one for Windows based on 4.19, which is the current long-term stable branch, and kernel updates will be handled through Windows Update, so no user involvement will be required to keep the Linux system up to date by the end-user.
In addition to the added compatibility, the new virtualized Linux kernel brings some hefty performance increases for tasks that are heavy on system calls, with Microsoft seeing up to 20 times better performance with WSL v2 compared to v1 when unpacking a zipped tarball, and 2 to 5 tives better performance using git clone and other projects. Plus, you can still access and edit files with Windows utilities as well, and Microsoft has been adding support to the different end of line characters for Linux vs Windows in applications like Notepad.
If you use Windows Subsystem for Linux, these changes should be all good news. There will likely be some teething pains during the transition, but Microsoft is releasing this in June to the Windows Insider Program for feedback. That program hasn’t had a great reputation at finding bugs before release in the past, but it will allow people to get some hands-on time with the changes before they roll into production. Microsoft hasn’t officially stated what release this will be a part of, but it could be as early as this fall depending on how far along the team is and how the feedback goes.
The other major announcement today for the command line on Windows is a new Windows Terminal app, which brings some much-needed attention to the basic command line shells in Windows. Windows Terminal will be delivered via the Windows Store and offers a bevy of features that should make any command line guru excited, even if you never use Linux, although it does tie in nicely to the WSL. Terminal will offer tab support, allowing you to have multiple different shells open at the same time, including Powershell, command line, SSH, and more. You can just launch a new shell and pick when you hit the plus sign for a new tab. It also supports tab ripping, so you can move one tab to a new session or different session if you’d like
Terminal also brings with it GPU accelerated DirectWrite based text rendering, which allows for additional characters to be supported as well as symbols, which means yes, emoji are now supported in the command line. Although this may sound like something no one needs, Microsoft showed a simple test suite which leverages emoji for pass, partial, and fail, and I have to admit that is a smart use for symbols, offering instant color-based recognition for the various results.
Microsoft has also developed a new font just for Terminal which is open-sourced. It’s designed as a monospaced font for programming, so it’ll be nice it develop over time.
Windows Terminal will also allow for theming, as well as extension support, and it’s an open-source project so you can download it yourself right now and compile it if you want to get in early. For those that aren’t interested in compiling it themselves, the team hopes to have it available by summer 2019 through the Windows Store for preview, and winter 2019 as a launch target for Terminal 1.0.
Terminal will allow users to create profiles for each shell if they’d like to, allowing them to customize the experience depending on what tool they are leveraging. You can change the theme, font, blur, transparency, and more, making each shell unique so you know exactly what shell you are in at any time.
As someone who uses the Windows command line quite a bit, Windows Terminal looks like a breath of fresh air, and catapults the command line years ahead of where it is now. Microsoft has updated it with some nice features over the last couple of releases, such as resizable windows, easier copy and paste, and more, but they were running into issues where additional changes may break existing scripts, so rather than continue down that path, they’ve started fresh. The existing console will still be available for backwards compatibility.
If you are a developer, a system admin, or just someone who wants to tinker with Linux or various shells, today’s announcements are very exciting. It’ll be fun to give these changes a spin when released.
Source: Microsoft Blog