8 ms·
> This is a real native Bash Linux binary running on Windows itself. How does it work without VM? I'm super curious!
by drinchev 11y ago
> This is a real native Bash Linux binary running on Windows itself.
How does it work without VM? I'm super curious!
- nickysielicki 11y agoThe same way Wine works for Windows binaries. Translate system calls.
- vetinari 11y agoWine has it easier - it does not translate system calls, it needs "only" dll loader and a set of dlls exporting the right symbols. NT system calls are not exposed to userspace; only system-supplied dlls can use them. It is done by changing syscall codes for every build, so non-system app would never know, which syscall number to use.
- nickysielicki 11y agoHuh, TIL. That explains why Wine always seemed so buggy, though.
- pionar 11y agoThey added a subsystem in Windows that responds to Linux APIs.
- tkubacki 11y agoLol "linux is a cancer" has new meaning now :)
- stcredzero 11y agoIs it a cancer if it doesn't kill you, but actually helps you be stronger? Maybe Linux is more like gut bacteria now. Linux is E.Coli?
- tripzilch 11y agoe.coli isn't a gut bacterium, ... is it?
- fla 11y agoThink of it as Wine, reversed.
- darkr 11y agoEniw?
- unclenoriega 11y agoEmulator Not In Windows Sorry it's not recursive.
- stcredzero 11y agoEnterprise Networked Internet Workstation?
- ant6n 11y agoENIW is 'Nix In Windows
- vram22 11y agoVinegar?
- vram22 11y agoEverywhere Now Is Windows
- PeCaN 11y agoThey've had a POSIX subsystem (SUA) for a while, but it's kind of ancient. I assume they resurrected it and implemented some Linux-specific APIs, which would actually be SO COOL.
- bitcrazed 11y agoNo - this is a whole new thing. The Windows POSIX subsystem which shipped in NT 3.5.1 was a minimal implementation of POSIX syscall API plus a userland toolset. That was replaced with Interix which was renamed Services for Unix (SFU) which had a more comprehensive kernel implementation and more up to date userland. However that tech was not resurrected to build the Windows Subsystem for Linux (WSL). Importantly, WSL doesn't ship with a distro - we download a genuine Ubuntu userland image at install-time and then run binaries within it.
- tavert 11y ago> Importantly, WSL doesn't ship with a distro - we download a genuine Ubuntu userland image at install-time and then run binaries within it. So can we use WSL by itself and pick a different distro, if we'd rather use say Alpine or openSUSE or Arch's userland?
- JdeBP 11y ago> However that tech was not resurrected ... I, for one, would like to see it resurrected. It's exceedingly useful, and is one major reason that I am not, nor will be, using Windows 10. This new subsystem does not have the things that I use SFU/SFUA for. Nor does it have the BSD-style toolset of SFU/SFUA.
- brobinson 11y agoDoes Windows 10 still ship with the OS/2 subsystem? (os2ss.exe)
- gpvos 11y agoIt was dropped with Windows XP. https://en.wikipedia.org/wiki/Architecture_of_Windows_NT#User_mode https://en.wikipedia.org/wiki/Architecture_of_Windows_NT#Use...
- drinchev 11y agoCurious to see what's the support of the Windows API then. Follow up questions would be if it will support kernel-dependent utils like tcpdump, ifconfig, etc.
- keithpeter 11y agoSo LINE on Windows like WINE on Linux? Seriously:shows an appreciation of where a lot of the workload for computer programmers is these days.
- igravious 11y agoCame here to say that. It'd be nice if they open-sourced it so it wasn't yanked away from under our feet one day :) But maybe they are? I shouldn't presume they are not.
- jdcarter 11y agoIn other words, they're not using "Linux" at all. It's an Ubuntu userland on top of the Windows kernel, similar to how Nexenta was an Ubuntu userland on top of the OpenSolaris kernel.
- bitcrazed 11y agoYou pretty much nailed it :)
- 0x0 11y agoI wonder too. I think that even the win32-native msys2 ships with a bash that uses cygwin's dll. Apparently some POSIX/Linux system calls are extremely hard to emulate under win32, such as fork: https://cygwin.com/cygwin-ug-net/highlights.html https://cygwin.com/cygwin-ug-net/highlights.html (search for "Process creation"), which I'd imagine would be critical in a shell for handling redirections, pipes, and job control.
- johnhattan 11y agoApparently they re-implemented the Linux API's along with the ability to run Linux executables directly.
- teamhappy 11y agoHave a look at FreeBSD's linuxulator. It basically maps syscalls (and a bunch of other stuff) from one OS to another. Alexander Leidinger has written a whole lot of blog posts about it - this one's a good start: http://www.leidinger.net/blog/2010/10/27/the-freebsd-linuxulator-explained-for-developers-basics/ http://www.leidinger.net/blog/2010/10/27/the-freebsd-linuxul...
- stormbrew 11y agoIs there a source for this being a syscall emulation layer and not some kind of colocation of the linux kernel in a subsystem somehow? The latter would be much more interesting to me, since what I really want out of "running linux on my desktop" is for it to actually act like the linux machines my code is targeting, and I'm dubious that a syscall layer will achieve that to the degree I want.
- kybernetikos 11y agoA good few years ago now I used to use a project called cooperative Linux that was like what you describe - a user mode Linux kernel running as a service in windows.
- stormbrew 11y agoYeah there were actually a couple of projects along this line at various points, but they always suffered in various ways from not being well integrated into the system. What you really want is for the colocated kernel to have first class access to some basic things about the primary kernel (like file systems -- including page caching and networking) so they're not going through an expensive and awkward translation layer. Cygwin and things like colinux exist on opposite ends of that awkward divide, but something officially supported by the OS could maybe straddle it better.
- kuma4 11y agoI feel it is related to Windows Server container. Maybe Ubuntu works like a Docker container on Windows.