• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

bash and other Linux command line utiltiies coming to Windows 10

Status
Not open for further replies.
This reminds me that they are doing OpenSSH for powershell as well. Better check out how far along they have gotten on that, since it's pretty much the only thing that I really need for my Windows box at this point.
 

le-seb

Member
Maybe I've finally found a reason to upgrade my laptop from 7 to 10, then.
As a UNIX guy being forced to use Windows at work, that's effing nice.

Good job, Microsoft.
Now, if you could fix your CAPS-LOCK key so that it doesn't act like a SHIFT-LOCK key...
 
So we have one group working on getting Android programs to work natively on Linux, one group working on getting OSX programs to work natively in Windows, and Microsoft themselves working on getting Linux working natively in Windows.

Life may be good in a few months.
 

Erheller

Member
WHAT

Now I don't have to worry about installing cygwin every time I clean install.

And now I can program while I play games
 

le-seb

Member
X Forwarding? :)
That would be awesome, but one step at a time, mate.

I say Windows users need to discover the greatness of a proper Caps-Lock setup and character composition, first. ;)

They haven't talked about this, but I can't imagine why it wouldn't be possible. We already have Windows X clients, after all.
These clients bring their own X server implementation to Windows, though.
If basic tools like screen have problems running because the terminal emulation is not solid, I don't expect an X server to run properly from this environment. Not yet at least.
 

Aeana

Member
I heard from a reliable source that X is not supported.

If they're able to run Linux binaries natively, then why wouldn't it be possible to run an X server and just connect to it with an X client? Perhaps they just mean they don't plan to do any sort of X->native Windows windowing system translation?
 

AlexMogil

Member
I heard from a reliable source that X is not supported.

Ah well. There are solutions. I just wanted something integrated.

If they're able to run Linux binaries natively, then why wouldn't it be possible to run an X server and just connect to it with an X client? Perhaps they just mean they don't plan to do any sort of X->native Windows windowing system translation?

Maybe it's sandboxed? Shouldn't make a difference I guess. I dunno, kinda grasping at straws.
 

MartyStu

Member
If they're able to run Linux binaries natively, then why wouldn't it be possible to run an X server and just connect to it with an X client? Perhaps they just mean they don't plan to do any sort of X->native Windows windowing system translation?

Probably because X requires some additional considerations beyond mapping syscals and they are unwilling to do the work.

Still, if things are even close to being what they say it is, the community can get X to run.
 

le-seb

Member
If they're able to run Linux binaries natively, then why wouldn't it be possible to run an X server and just connect to it with an X client?
The X servers require access to the hardware (or at least a framebuffer device).
Their API probably doesn't cover the required system calls and drivers.
 

captive

Joe Six-Pack: posting for the common man
So for those of us who only rarely touched linux, how would having a bash shell implemented in W10 be good and useful? I'm genuinely curious to know what the niche is that bash fills that isn't already filled by cmd and powershell. I'm still learning powershell and have written a script or two, and I've used cmd since the days of DOS 3.3, but I've only screwed around with linux in a VM and using raspian, so I'm not really familiar with all the ins and outs of bash.

I know people can be sensitive about their favorite programs, so I'm not trying to start anything, I just want to learn.

Ahhh, okay. So it's more of a development environment thing? That makes sense. Should be good stuff. I guess it isn't super relevant to my workflow on an all windows network, since I spend a lot of my time remoted into a windows server, working in AD and in powershell. But this makes sense that it'd be a huge get to be able to work with git without installing anything else.

Aw man, all our devs are going to want to upgrade from Win7 this summer, I bet...

its useful if you already know linux/unix BASH, its useful if your cross platform linux/windows.

Sounds like your straight windows, powershell is your best bet, but if you like learning new things have at it.
 
Ah well. There are solutions. I just wanted something integrated.



Maybe it's sandboxed? Shouldn't make a difference I guess. I dunno, kinda grasping at straws.

It's not sandboxed. And I honestly don't know, but my guess is that the interaction with Windows' window manager and graphical susbsystem is not easy to work out.
 

MartyStu

Member
It's not sandboxed. And I honestly don't know, but my guess is that the interaction with Windows' window manager and graphical susbsystem is not easy to work out.

Regardless of difficulty, they really do not have much incentive to make it work.

X is dying a decades-long death and most of the *nix stuff people care about are not gui-based.
 

AlexMogil

Member
It's not sandboxed. And I honestly don't know, but my guess is that the interaction with Windows' window manager and graphical susbsystem is not easy to work out.

Don't care, I'm not nitpicking, I love the sound of all of this especially since Canonical is on board.
 
It's not a port. It's the Ubuntu binary running on Windows. Think Wine but the other way around.
It's the same source code for bash, but recompiled to link against the new libraries that they had to create to emulate Linux system calls:
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).
Thus this doesn't achieve true binary compatibility; Linux applications will have to be recompiled against WSL to work.

Wine has a solution for this where they emulate the NT kernel in a process; some older operating systems (mostly microkernels trying to achieve Linux binary compatibility) also did this to solve the same issue (which I alluded to in my previous post). It doesn't sound like MS has come up for a solution for this yet. The "make something that deals with unhandled traps" runbook is kinda clunky and can be done better, and I'm sure MS knows it can come up with something.
 

Aeana

Member
It's the same source code for bash, but recompiled to link against the new libraries that they had to create to emulate Linux system calls:

Thus this doesn't achieve true binary compatibility; Linux applications will have to be recompiled against WSL to work.

Wine has a solution for this where they emulate the NT kernel in a process; some older operating systems (mostly microkernels trying to achieve Linux binary compatibility) also did this to solve the same issue (which I alluded to in my previous post). It doesn't sound like MS has come up for a solution for this yet. The "make something that deals with unhandled traps" runbook is kinda clunky and can be done better, and I'm sure MS knows it can come up with something.

The initial source explicitly says native, unmodified binary compatibility, and now some people are saying no... I'd like to get the actual skinny on all of this.
 
It's the same source code for bash, but recompiled to link against the new libraries that they had to create to emulate Linux system calls:

it's not recompiled. If you run apt-get, you are downloading a package FROM Ubuntu, the same bit for bit, checksum matching executable that someone on actual Ubuntu gets.

The initial source explicitly says native, unmodified binary compatibility, and now some people are saying no... I'd like to get the actual skinny on all of this.

it doesn't need to link against anything special. it uses an entirely different loader. It is not the normal windows loade.r This new loader recognizes that it is an ELF file, parses the ELF file, and then does all the work necessary to create the process and dynamically load all these emulation libraries into the process to translate linux syscalls into windows syscalls
 

riotous

Banned
The initial source explicitly says native, unmodified binary compatibility, and now some people are saying no... I'd like to get the actual skinny on all of this.

I believe Codeacious is wrong; this blog post is from an MS employee showing it off:

http://www.hanselman.com/blog/Devel...ndUsermodeUbuntuLinuxBinariesOnWindows10.aspx

Running bash on Windows hits in the sweet spot. It behaves like Linux because it executes real Linux binaries. Just hit the Windows Key and type bash.

After you're setup, run apt-get update and get a few developer packages. I wanted Redis and Emacs. I did an apt-get install emacs23 to get emacs. Note this is the actual emacs retrieved from Ubuntu's feed.

It's Ubuntu on Windows.

image_2fe8f62c-c4d1-4cba-863c-db5e9c60b4f8.png


image_265b1f35-2e11-4abc-8beb-5909c2345d8a.png


image_fd4d324c-6451-4628-9f6c-ed36628eb759.png
 
The initial source explicitly says native, unmodified binary compatibility, and now some people are saying no... I'd like to get the actual skinny on all of this.
MS might have a solution for this, and maybe have developed a Linux syscall springboard already (or something similar that works better with the Windows kernel) that would permit true binary compatibility. However, I don't see such a mechanism mentioned in the article linked in the OP, nor have I seen talk anywhere else today mentioning it. I'm confident that MS will achieve true binary compatibility, but there's another mechanism here that they're not talking about that I want to see before I believe. I am extremely excited by the progress MS has made so far though.

EDIT:
I believe Codeacious is wrong; this blog post is from an MS employee showing it off:

http://www.hanselman.com/blog/Devel...ndUsermodeUbuntuLinuxBinariesOnWindows10.aspx
it doesn't need to link against anything special. it uses an entirely different loader. It is not the normal windows loade.r This new loader recognizes that it is an ELF file, parses the ELF file, and then does all the work necessary to create the process and dynamically load all these emulation libraries into the process to translate linux syscalls into windows syscalls
Ah, this was the piece I hadn't seen explained or linked to by any of the articles that I wanted to know about. That's a very interesting approach that involves a good amount of extra bookkeeping and overhead when context switching, but it certainly can be done. I'd be very curious to know how much faster this approach is compared to the older "user-level springboard" I mentioned above.

Adding a linux subsystem means they have the freedom to make an entirely new loader for it that can load ELF binaries and then dynamically load all the shim libraries in and affect the process in whatever way they want to before running.
Yeah, see my edit just above. The article in the OP and the ones I read elsewhere all just explained the WSL libraries, which made it sound like MS wanted developers just to recompile against the new libraries. I didn't have any idea if they were springboarding or using some other solution for actually getting Linux binaries to use WSL.
 
MS might have a solution for this, and maybe have developed a Linux syscall springboard already (or something similar that works better with the Windows kernel) that would permit true binary compatibility. However, I don't see such a mechanism mentioned in the article linked in the OP, nor have I seen talk anywhere else today mentioning it. I'm confident that MS will achieve true binary compatibility, but there's another mechanism here that they're not talking about that I want to see before I believe. I am extremely excited by the progress MS has made so far though.

The mechanism is already mentioned. It's a "Linux subsystem for Windows". That's not just a way of glossing over the details, that *is* the detail. You can build apps for different subsystems in Windows, and what subsystem your program runs under completely changes its capabilities. See the list of existing subsystems here.

Adding a linux subsystem means they have the freedom to make an entirely new loader for it that can load ELF binaries and then dynamically load all the shim libraries in and affect the process in whatever way they want to before running.

Just saying "Linux subsystem for Windows" is enough to confirm this, but when the developer from Canonical who is responsible for all this confirms "bit for bit, checksum for checksum compatibility", I don't think there's any doubt remaining.
 
Status
Not open for further replies.
Top Bottom