Windows Bash vs Ubuntu in VM and the SSH
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.
Androme
Updated on September 18, 2022Comments
-
Androme over 1 year
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?
-
Androme almost 8 yearsThank 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.
-
jlliagre almost 8 yearsYou 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.
-
kronenpj almost 8 yearsThat'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
ortr
. I'm happy to be wrong though - those utilities make it more useful to me