5

i have been looking around for some time, but i have not been able find out what the difference is between the new Bash For Windows 10 and a ssh into a Ubuntu running in a VM (With the windows drives mounted).

Do it have more integration with windows, or is the access and ease of install just it over a Ubuntu install running in a VM?

| improve this question | | | | |
8

The difference is essentially the one between operating system level virtualization and hypervisor based virtualization.

When you launch bash from the Windows Start menu, you get a text window with access to a full Ubuntu command line environment from where you can install any userland Ubuntu package.

Unlike what you would get with a traditional VM, there is no Linux kernel to boot or to run, so it is much faster to start and lighter to run. Ubuntu native binaries are simply executed by the Windows kernel (precisely a new subsystem of it). Another difference is there is no graphic integration out of the Box. With a VM, you have access to a window (or a full screen) representation of the text and graphic console of the virtual hardware but with Windows bash, it is more like if you remotely connect to a server from a windows terminal emulator. You might nevertheless run Linux graphic applications if you start an X11 server on Windows. As there is no Linux kernel involved, you cannot use Linux modules/drivers to access your hardware, it will be accessed by the Windows native ones. This has many implications, for example there is currently no support for symlinks and issues with long file names and file name case, no inotify. There is no boot sequence like with a real machine or a traditional VM, that means no services are started automatically when you start bash. It is slightly similar to Docker launching bash.

Finally, this is a work in progress so there is a lot of room for improvement. You might have an idea about what the users report the most about in that site https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windows

Have also a look to the FAQ: https://msdn.microsoft.com/en-us/commandline/wsl/faq

Note the first user request "Let us launch Windows processes from Bash" is something you can't do either from a Linux VM running on Windows.

| improve this answer | | | | |
0

All three are tools fulfilling different uses or purposes. Deciding which is partially a preference and partially correct or adequate selection of a tool.

I've not used it, but from what I've read about Windows BASH, which is precious little, it is a slightly isolated BASH shell environment. It does not have access to system-level information or APIs that Powershell does, for example. It does not provide a UNIX-like command environment, nor does it provide SSH. But it can run programs and applications much like BAT files can, but with scripts written using BASH syntax.

Cygwin is a library-based abstraction of a (more-or-less) full UNIX-style POSIX environment. It can have access to system-level information and APIs if such an interface is written, and many have. It feels much more like a UNIX-style environment but there are obvious adaptations that need to be made to accomodate "windowsisms." E.g. to access a Windows drive, like D, it's /cygdrive/d/. Directory separators in a path are / rather than \ and access to a network drive is //host/share/path... I use it daily at work and I find it very useful to my UNIX-style thinking.

Linux run in a Virtual Machine is a complete installation and (almost) completely isolated from the host system, except at specific, defined points like networking, keyboard/mouse, memory, etc...

| improve this answer | | | | |
  • Thank you give me some input, I will leave the question open for a bit more to give other people change to come with some input aswell. – Androme Jul 18 '16 at 2:06
  • 1
    You statement " It does not provide a UNIX-like command environment, nor does it provide SSH." is quite misleading. The Linux subsystem does provide a full UNIX-like (Ubuntu) command environment and it has network access so you can run ssh. What it can't do is accessing the the Windows API, but Ubuntu in a VM won't be able to do it either. – jlliagre Jul 18 '16 at 6:44
  • That's why this was a comment rather than an answer. I stated that I'd read precious little on win bash. My impression from the article was that it doesn't give you utilities like ls or tr. I'm happy to be wrong though - those utilities make it more useful to me – kronenpj Jul 18 '16 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.