Linux on Windows. That’s LOW.

Interesting announcement from Build: Developers can run Bash Shell and user-mode Ubuntu Linux binaries on Windows 10

So, what’s that all about? Things seem very unclear to me at the moment, but I have not had the time to read loads of posts that spring up here and there, or to determine whether some of them are less secretive than Scott’s post I linked to above.

The promises are altogether a bit strange and conflicting. For instance, Scott says

This isn’t Bash or Ubuntu running in a VM. This is a real native Bash Linux binary running on Windows itself.

So it’s a bash.exe somehow built against Windows libraries? I think that has been around for a long time – I used Cygwin, but I think there were more “native” builds around as well. However, Scott also says

This is an genuine Ubuntu image on top of Windows with all the Linux tools I use like awk, sed, grep, vi, etc.

An image, eh? So how does that image do anything without some kind of VM container/sandbox? Logically I think this is impossible. So there’s likely some kind of VM in the picture.

Not a problem, but in order to judge how useful this may be, my main questions are about integration. That has always been the main disadvantage with Cygwin, that integration wasn’t always optimal. It was actually pretty good, so I’m not sure what this new approach gains in that regard – but of course having a full Linux system at my disposal with standard packages and everything is a cool idea.

Back to integration though – of course I’ll want to work seamlessly with the files on the Windows system. I certainly hope they make this possible, but there’s no mention at all about this. I’m sure some people will want to take integration way further, so this is the most important topic that needs explanations and a roadmap to keep up with promises.

Now, the title of this post is obviously meant as a bit of a joke. However, I have to admit I’m not altogether convinced that this is a great thing. Sure it’s cool to see Microsoft do something to underline their new openness and to deliver additional value in Windows to developers. But there would be other ways of doing that. I have built countless Unix tools from scratch, many of them using the brilliant configure scripts and variations of them. Many of these tools even have build options for Windows, although these are sometimes flagged as being a bit outdated.

If Microsoft was really serious about opening up, they could act on these points:

  • Accept that the Windows command line environment isn’t as powerful as some people would like it to be, and that Powershell isn’t everybody’s cup of tea (and in my eyes, has always been more of an admin tool than a really useful general purpose command line environment in the Unix tradition). I’m mentioning this purely because it’s my experience that common demands made by Unix-aficionados are usually met with an understanding but ever so slightly condescending attitude.

  • Help move Windows and Unix tools closer together. Remember that NT 4 promised to be POSIX compliant. Put developers on Open Source projects to achieve Windows compatibility, and do what’s necessary in Windows to embrace these tools.

  • Provide a repository of packages built for Windows. Why do I have to run any kind of non-native environment to use apt-get?

Note that I’m not claiming all this is necessary at all. To the degree I’ve used Unix-style tools on Windows in the past, I’ve personally been quite happy with everything. But this announcement seems to point out that Microsoft wants to take things further – only where they want to take it isn’t very clear. At this point it sounds to me like this is a VM with some integration features. Nothing inherently wrong with that. But why? And why this approach?

2 Comments on Linux on Windows. That’s LOW.

  1. You said: “Logically I think this is impossible. So there’s likely some kind of VM in the picture.” Not so, apparently. As it says in http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html “This isn’t a virtual machine at all” and “we’re talking about bit-for-bit, checksum-for-checksum Ubuntu ELF binaries running directly in Windows”

    You ask “So how does that image do anything without some kind of VM container/sandbox?” Well this is not new – the very first versions of Windows NT had something very similar: they could run executables originally built for various different platforms. (E.g., there was support for running OS/2 binaries natively. And there was also support for certain kinds of POSIX binaries, as you alluded to yourself.) I don’t know if they’ve resurrected this same mechanism, but from the technical descriptions it sounds like something very similar: a new subsystem on Windows that enables you to run native Linux ELF binaries.

    You really don’t need a VM for that. All that’s really required is that processes of this kind present a syscall interface that looks sufficiently like Linux’s that the tools work.

    It’s still virtualization, but virtualization doesn’t necessarily require a VM. Windows has been providing various virtualization features for ages, e.g., fooling legacy code into thinking it has admin privileges while actually sandboxing it by giving it write access to something that looks like the C: drive (and HKLM, and everything else admin code gets access to) but isn’t. This ELF binary support is a little more extreme of course – it’s a completely different syscall interface rather than some minor tweaks to bits of the existing Win32 one. But then Win32 itself was originally conceived as just one subsystem capable of running on top of the same kernel as others, so in a sense, Win32 has always been virtual, in the sense that it’s not actually the underlying native API.

    Like

    • Hey Ian, thanks for commenting with these details! You’ve obviously spent more time digging and thinking than I have.

      I’m still wondering about the image-based mechanism they describe (Scott: “…This is an genuine Ubuntu image on top of Windows …”). I was assuming that this included a Linux kernel for instance, perhaps it doesn’t. Maybe Scott should have defined the specific meaning of “genuine” he was going for 😉

      I guess the term VM isn’t really very precise when it comes to these details – I would argue that a system which includes specific binary execution support as well as image-based distribution and possibly sandboxing of some kind could be called a Virtual Machine. But I’m fine with any label we want to attach to it – hopefully they’ll make more details available soon. Perhaps the reality is much closer to what I was suggesting as my “better solution” and they only managed to write the announcement in a way that hides how good it is.

      Like

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s