Ubuntu on Windows?
With Microsoft and Canonical working together on a number of projects, the Internet has been rife with speculation and rumors. Some feared that Microsoft was planning to buy Canonical and shut down Ubuntu. Others wondered if they were planning to embrace FOSS and make Windows open source—but nobody quite expected this.
Microsoft and Canonical have spent the last several months working in secrecy to bring Ubuntu to Windows—and not through virtualization or a containerized environment. No, the goal was to run Linux apps natively in Windows.
Before I get into how that's even possible, let's take a quick look at why they would ever do such a thing. First, it's important to note that this move is aimed to support developers, not regular users. As such, there's no support for the full array of Linux GUI applications (such as the X Window System, desktop environments and the vast array of Linux desktop apps and games). Instead, the focus is very much on the command-line interface, particularly the Bash shell.
As any seasoned Linux developer or administrator will tell you, the CLI offers unparalleled power. And even those who have learned to love the bells and whistles of modern integrated development environments still use the terminal heavily in their daily work.
Although Windows does have a CLI interface (PowerShell), it doesn't measure up to the full power of Bash and the full suite of CLI tools found in any standard GNU/Linux distro. This is largely due to Linux's long legacy of mature CLI tools, which dates back to the earliest days of UNIX.
So bringing Bash to Windows will put a powerful arsenal of new tools in the hands of seasoned developers. But how does Microsoft benefit?
In the past, Microsoft has operated on the basis of building a closed platform. Its strategy had been to lock users and developers into a platform that was incompatible with other operating systems. The success of this strategy played a big role in Microsoft's growth.
But the emergence of the Web struck a huge blow to this plan. Windows may have dominated the desktop space, but there was fierce competition in the server space. When the dust settled, Linux had won the battle for supremacy in the Web server world. It was simply the most effective platform for the job.
This meant that Web developers had to be able to write code that ran on a Linux platform, even if they were working on a Windows laptop. Since the two operating systems are quite different internally, this was sometimes quite difficult. And, that's one reason why quite a large number of developers have switched from Windows to Linux or OS X.
Today, cross-platform development is more important than ever. Development teams often strive to support multiple devices and operating systems. Being able to write code for all those systems from a single operating system is a big advantage.
Developers and users jumping ship is bad news for Microsoft. That's why creating a solution to keep developers happy is a high priority.
There have been several third-party tools that aim to simplify Linux development on Windows. On the one hand, there are virtual machines, which can run virtually any operating system in a sandbox, but VMs always come with a heavy performance penalty.
Then there are tools like Cygwin that create a Linux-like environment for the Windows command line. But although the environment is familiar, it falls short of supporting the full array of commands and features that would work on a normal Linux environment.
The "Bash for Windows" team members took an entirely different approach. Their aim is to provide the complete Linux CLI environment by running a GNU/Linux distro (in this case Ubuntu) on top of Windows. Well, it's complete but for one notable exception—the Linux kernel.
The Linux kernel is the heart of any GNU/Linux operating system. It runs the software that comprises the complete operating system, including all the services, dæmons, utilities and applications.
Windows has a kernel too (the Windows NT kernel). It performs the same role in a Windows system, and both of the kernels interact with the other OS components through an interface. But, the two kernels have very different interfaces.
If you could re-create a kernel's interface, you should be able to run software that was compiled to run on that kernel. That's how the popular Wine package works.
Wine is a tool that allows Linux users to run Windows apps. It does so by translating Windows system calls to Linux ones. From the viewpoint of the Windows application, it seems that it's running on Windows. And to the kernel, the application looks like a normal Linux process.
The "Windows Subsystem for Linux" works on the same principle but in reverse. What Microsoft has done is build a "reverse Wine" that translates Linux syscalls into Windows ones.
Of course, there's more to this than simply mapping one set of system calls to another—the architectural differences between the two kernels make the task quite complex. And, that's why there are still some Linux apps that aren't fully supported by the new system.
For instance, it's possible to run Ruby on Rails, but there are some popular GEMs (Ruby packages) that won't install—yet.
It's an impressive accomplishment, made possible by the collaboration between Microsoft and Canonical, and there are plenty of individual developers and startups who will welcome the news. But, there are many in the FOSS world who will greet the news with suspicion. The project has only just been announced, and it's not even broadly available yet (it will be beta released in a couple weeks).
It will be interesting to see where this is leading. Do you think it's a good thing for the Linux community? Leave your opinions in the comments below.