How does the new "Bash on windows 10" really work?
It's not an emulator in the same way that WINE Is Not an Emulator. That is to say, they've added a Linux kernel interface to their Windows kernel. When an app tries to use the Linux kernel, it gets translated into a Windows native system call and any responses from the kernel is translated into a native Linux response. So the app thinks it's running on a Linux kernel and hence doesn't need to be modified.
However, this is purely a Windows technology so if you want more details, you should get them from a Windows support group or something. Windows continues to be a proprietary OS, so I would expect a limited amount of details.
And is it really going to be as stable and user friendly as bash in ubuntu?
From an Ubuntu perspective, we're simply running on a primitive Linux kernel, comparable to running a modern desktop on a primitive X server. If you're only using the features supported by the fake kernel, then it'll be stable and user friendly. If you use unsupported features, it'll be unstable.
It will not be anywhere near a complete Ubuntu experience any time soon.
For those curious as to how the Windows Subsystem for Linux (WSL) works and how it runs native Linux ELF-64 binaries, we've published a series of blog posts and accompanying videos explaining the WSL architecture, processes, syscalls, and filesystem support.
Scott Hanselman also did a great walkthrough video covering the installation process and how to configure Bash on Ubuntu on Windows:
HTH
The bash portions work very well in WSL.
The kernel portions aren't there. For example there is no /sys/class/backlight/intel_backlight/brightness
you can access to set screen brightness. There are Powershell commands you can easily call to do that if you don't mind COBOL style very long field names. MS Powershell can be called directly from within bash. So you can say powerful Windows features are now built into bash. By the same token MS Powershell can call bash I believe. So if true Powershell gets access to functions like grep
, awk
, head
, tail
, etc.
The GUI for Ubuntu Desktop (gedit
, nautilus
, etc.) only works after installing VcXsrv
or something similar.
Sharing files between Linux and Windows WSL is complicated to setup. When when moving files between the shared WSL+Linux NTFS folder I have had some file permission "weirdness" either due to my ignorance or software deficiencies.
Speed is a lot slower in WSL than it is in Ubuntu. You can actually see the screen paint character by character when you run cal
or toilet
: What are the differences between windows bash and cygwin?
I think WSL is a good product and I enjoy tinkering with it when dual-booting into Windows-World. It'll never become a great product because of MS lack of funding and they really don't want to have a great Linux Free-Ware Distro anyway. If you had enough RAM you would probably be happier with a VM. With only 8 GB myself and RAM prices rising until mid-2019 or so, I'll happily stick with WSL and forgo the 32 GB RAM upgrade for now.
I've visited a few MS forums and I must say Rich Turner and his WSL team members are some of the nicest professionals I've seen.