Most active commenters
  • umanwizard(5)
  • Delmania(3)

←back to thread

535 points raddad | 17 comments | | HN request time: 0.844s | source | bottom
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 #
1. umanwizard ◴[] No.11390731[source]
What's "Linux" about this and "not Linux" about Cygwin?
replies(2): >>11390764 #>>11390854 #
2. Delmania ◴[] No.11390764[source]
Cygwin translates calls to Windows via cygwin.dll. It works well for the most part, but in some corner cases, it doesn't work so well.
replies(2): >>11390814 #>>11391326 #
3. umanwizard ◴[] No.11390814[source]
I mean, how is that different from what's being done here? Is the actual Linux kernel running in some sort of container? This post is light on details but people here seem to be suggesting it just translates syscalls which afaict is the exact same thing cygwin does. (plus support for linux elf binaries, which doesn't really matter since most linux tools are open-source anyway)
replies(1): >>11391052 #
4. bboreham ◴[] No.11390854[source]
Cygwin requires a recompile. This is running Ubuntu binaries.
replies(2): >>11390879 #>>11391891 #
5. umanwizard ◴[] No.11390879[source]
So it's cygwin + ELF support in the kernel. I guess ability to run GNU tools + supporting ELF is being called "Linux". The latter piece seems pretty minor, especially since most things that run on ubuntu are open-source anyway.
replies(1): >>11391820 #
6. Delmania ◴[] No.11391052{3}[source]
See here: http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.htm...

> Microsoft research technology to basically perform real time translation of Linux syscalls into Windows OS syscalls

replies(1): >>11391098 #
7. umanwizard ◴[] No.11391098{4}[source]
So "Linux on Windows" isn't really happening here. Binaries intended to run on Linux are just being tricked to run on Windows -- basically the same as Cygwin, with the minor benefit of not requiring a recompile.
replies(4): >>11391194 #>>11391292 #>>11391904 #>>11392347 #
8. ashitlerferad ◴[] No.11391194{5}[source]
That is quite a bit different from Cygwin.

Running the Linux kernel on Windows has been done before IIRC - coLinux?

replies(1): >>11391380 #
9. Delmania ◴[] No.11391292{5}[source]
It's a lot more than that. When Cygwin is built, the translation between to POSIX is handled via Cygwin.dll with the various tools recompiled against that file.

This version is taking the native Ubuntu binaries and executing them directly against the Windows API via a real time translation later.

The difference is like playing a game using virtualization technology vs. WINE. As the complexity of the game increases, the former begins to slow down and break.

10. huuu ◴[] No.11391326[source]
Yes. You can quickly see this when running ping. On Cygwin it runs 3 times on Linux forever.

Edit: thinking about it I'm not sure if I'm right. Or does Cygwin map the ping command to the Windows command?

replies(1): >>11391485 #
11. gfody ◴[] No.11391380{6}[source]
That's what I was thinking but coLinux never did 64-bit
12. mmebane ◴[] No.11391485{3}[source]
> does Cygwin map the ping command to the Windows command?

It looks like Cygwin has a ping package, but it isn't something you'll get unless you specifically select it in the installer.

13. monocasa ◴[] No.11391820{3}[source]
No, it's supporting all of the linux system calls in the Windows kernel. Epoll, fork, exec, etc. It's a totally different implementation than cygwin.
replies(1): >>11392106 #
14. bitcrazed ◴[] No.11391891[source]
Yes - Cygwin is essentially the GNU tools recompiled as Win32 apps using a helper library for shared code etc.

Windows Subsystem for Linux (WSL) which underpins Ubuntu on Windows is new Windows kernel infrastructure that exposes a LINUX-compatible syscall API layer to userland and a loader that binds the two.

This means you can run real, native, unmodified Linux command-line tools directly on Windows.

15. pilsetnieks ◴[] No.11391904{5}[source]
"just"

You don't have to be a fan of Microsoft but they deserve at least some credit.

16. umanwizard ◴[] No.11392106{4}[source]
Got it, thanks.
17. gpvos ◴[] No.11392347{5}[source]
Cygwin is pure userland. This Linux API subsystem is a small bit of userland (similar to kernel32.dll in the Win32 subsystem), but mostly kernel code.