←back to thread

535 points raddad | 2 comments | | HN request time: 0.001s | source
Show context
hobs ◴[] No.11390553[source]
Some additional details from Scott Hanselman:

http://www.hanselman.com/blog/DevelopersCanRunBashShellAndUs...

"This is a real native Bash Linux binary running on Windows itself. It's fast and lightweight and it's the real binaries. This is an genuine Ubuntu image on top of Windows with all the Linux tools I use like awk, sed, grep, vi, etc. It's fast and it's lightweight. The binaries are downloaded by you - using apt-get - just as on Linux, because it is Linux. You can apt-get and download other tools like Ruby, Redis, emacs, and on and on. This is brilliant for developers that use a diverse set of tools like me."

"This runs on 64-bit Windows and doesn't use virtual machines. Where does bash on Windows fit in to your life as a developer?

If you want to run Bash on Windows, you've historically had a few choices.

Cygwin - GNU command line utilities compiled for Win32 with great native Windows integration. But it's not Linux. HyperV and Ubuntu - Run an entire Linux VM (dedicating x gigs of RAM, and x gigs of disk) and then remote into it (RDP, VNC, ssh) Docker is also an option to run a Linux container, under a HyperV VM 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. "

replies(11): >>11390574 #>>11390626 #>>11390693 #>>11390705 #>>11390731 #>>11390748 #>>11390890 #>>11391364 #>>11392443 #>>11393237 #>>11402098 #
drinchev ◴[] No.11390574[source]
> This is a real native Bash Linux binary running on Windows itself.

How does it work without VM? I'm super curious!

replies(5): >>11390600 #>>11390601 #>>11390609 #>>11390641 #>>11390652 #
teamhappy ◴[] No.11390652[source]
Have 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-linuxul...
replies(1): >>11390723 #
stormbrew ◴[] No.11390723[source]
Is 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.

replies(5): >>11390830 #>>11391008 #>>11391062 #>>11391170 #>>11391173 #
1. teamhappy ◴[] No.11391170{4}[source]
From linux(4):

     The linux module provides limited Linux ABI (application binary inter-
     face) compatibility for userland applications.  The module	provides the
     following significant facilities:

     +o	 An image activator for	correctly branded elf(5) executable images

     +o	 Special signal	handling for activated images

     +o	 Linux to native system	call translation

     It	is important to	note that the Linux ABI	support	it not provided
     through an	emulator.  Rather, a true (albeit limited) ABI implementation
     is	provided.
https://www.freebsd.org/cgi/man.cgi?query=linux&apropos=0&se...

"Mapping syscalls from one OS to another" was really just an example to give the OP an idea of how this sort of thing works without a VM.

Edit: Nevermind then

replies(1): >>11391542 #
2. stormbrew ◴[] No.11391542[source]
I wasn't asking about freebsd (I've used that, even!), I was asking about this new thing on Windows and whether there's been official word that it is indeed the same sort of thing. Looks like it is indeed this sort of thing, though.