Ubuntu’s bash and Linux command line coming to Windows 10
Microsoft built a Linux subsystem for Windows for Project Astoria, which is huge news for developers, developers, developers.
Written by Peter Bright / Courtesy of ArsTechnica
Microsoft built a Linux subsystem for Windows for Project Astoria, its system for running Android apps on Windows 10 Mobile.
But in February the company confirmed that Astoria was dead, as it rather undermined the Universal Windows Platform concept. At the time, we speculated that portions of Astoria might live on, as portions of it had mysteriously started showing up in Windows Insider Previews. And today, that has come to pass, with Microsoft saying that the Windows 10 Anniversary Update will include the ability to run the popular bash shell from Unix, along with the rest of a typical Unix command-line environment.
We’re still trying to get the inside story on what Microsoft has done here, but what we’ve known for several months now is that the company has developed some Windows kernel components (lxcore.sys, lxss.sys, presumably standing for “Linux core” and “Linux subsystem,” respectively) that support the major Linux kernel APIs. These components are not GPLed and do not appear to contain Linux code themselves; instead, they implement the Linux kernel API using the native Windows NT API that the Windows kernel provides. Microsoft is calling this the “Windows Subsystem for Linux” (WSL).
A kernel API is one thing, but to be useful you need user mode applications. For Astoria, this would have been a version of the Android Open Source Project, Google’s mostly BSD-licensed code that provides a Java-like runtime and various applications and system services. For WSL, however, Microsoft is turning to Canonical, creators of Ubuntu, for help. Canonical has provided a system image containing the Ubuntu versions of the various command-line tools that are typically found in a Linux distribution.
Our understanding is that these are not recompiled or ported versions of the programs (as are used in tools aiming to provide a Unix-like environment on Windows such as Cygwin) but instead unmodified programs. Microsoft is describing this in terms of providing a Linux-like command-line environment at the moment, but from what we can gather, there’s little fundamental restriction to this, potentially opening the door to running a wide range of Linux programs natively on Windows.
This is far from the first time that Windows has been able to masquerade as a Unix-like operating system. From its inception, Windows NT included something called the POSIX subsystem, offering an environment minimally supporting the standardized version of the Unix APIs. A third-party offering called Interix greatly extended this with a wide range of common Unix command-line tools. Microsoft bought Interix, rebranding it first as Services For Unix (SFU) and then Subsystem for Unix Applications (SUA). In one way or another, this Unix-like mode was supported up until Windows 8; Windows 8.1 removed it.
Whatever their names, these various subsystems suffered primarily from appearing to software as yet another Unix variant. They contained subtle differences from the POSIX support found in both FreeBSD and Linux, and they didn’t provide the various non-standard extensions found in those kernels. This meant that porting applications to compile and run correctly was challenging.
This time around, things could well be different, though the proof of the pudding will be in the eating. We can’t wait to give it a spin and poke around under the hood.
Read the original article over at ArsTechnica.