One of the features that Microsoft have added to Windows 10 Anniversary Edition is the ability to install the Windows Subsystem for Linux - or WSL.
Yes - Microsoft have turned right round, and instead of doing their best to kill Linux, they are now embracing it by adding a Bash shell environment to Windows.
You will also see this referred to as Bash on Ubuntu on Windows.
Microsoft have teamed up with Ubuntu - who produce one of the quite well known distributions of Linux - and they have added a sort of minimised version of Ubuntu linux that sits on top of the Windows file system , to produce a Bash shell command line environment inside Windows.
It is not a Virtualised installation, it is part of Windows, and has direct access to the Windows file system.
It also uses the Windows kernel.
Whether it is accurate to call it a Bash shell, or whether it should be called a Bash shell lookalike, is open to debate.
Bash on Ubuntu on Windows is based on Ubuntu Trusty 14.04, and Bash version 4.3.11.
Note that Bash on Ubuntu on Windows is just that - a command line shell. There is no GUI, so graphical Linux programmes are not going to run.
Microsoft have said that Bash on Ubuntu on Windows is for developers who want to work in a command line environment, and they have no plans to add a GUI.
But - there are already existing X Servers that can be installed on Windows, and there are pages on the internet about getting the Bash shell to talk to them - so go and play if that`s what you want to do.
I gather that somebody somewhere has managed to run the default Ubuntu 14.04 desktop on WSL - the desktop, not the full Ubuntu linux.
I tried two different X servers, VcXsrv and Xming, one after the other - they behaved pretty much the same way, and looked a bit too similar to be different programmes - either there is a lot of plagiarism going on, or they come from the same place.
They both installed easily enough, but then they both told me they wanted to cut a hole through the firewall - so I cancelled that, but both of them cut a hole anyway. And every time I ran them, they cut the hole again. So that was bad news.
I also installed Gedit from the Ubuntu repository - it is a smart text editor that would be handy to have on WSL. In the installation process Ubuntu installed another 240 Mbs of files onto my computer - that`s a lot of files, and included files to do with GTK, Gnome, Javascript, Python, etc, etc. So that was a bit unexpected.
Then after all that, gedit didn`t work properly on either VcXsrv or Xming - I did get gedit in an X server window - however it had very much reduced functionality compared to how it should behave, to the extent it wasn`t useable.
I also got a load of error messages, a lot of them about D-Bus - D-Bus is a software bus that interconnects multiple processes running on the same machine - I don`t know if WSL has it or not as part of the Linux environment.
I don`t like programmes that cut holes through the firewall and don`t allow me to stop it, and it wasn`t a success anyway, so I removed both VcXsrv and Xming after I had tried them.
WSL, or Bash on Ubuntu on Windows, is not installed by default on Windows 10 1607, it needs to be installed.
WSL can be installed on all versions of 64 bit Windows 10 Anniversary Edition, including Home. It cannot be installed on 32 bit versions.
There is a lot of wrong information on the internet about how to install it, and it took me quite a while to get it to install.
Because I went round in circles quite a lot, I can`t provide a procedure, but I think there are three things you need to do -
And I think that was it. Maybe !
Updates for the Linux environment can be done by Ubuntu using "apt-get update" and "apt-get upgrade", and it worked well.
I have no idea if Microsoft might try and deliver updates for the Linux system, hopefully they won`t.
They probably will at some point do updates for bash.exe, which is the Windows executable that starts the Bash shell environment. Hopefully it won`t break it !
The Linux subsystem behind the Bash shell is built on the Windows file system, not on a separate Linux file system.
In a normal Linux installation, Linux runs on a VFS - or Virtual File Sytem - if my limited understanding is correct, this is an intermediate layer between the user and the various devices such as an ext4 file system on the hard drive, a CD, a USB stick - so that all these different types of file system appear to the user as the same.
VFS uses Inodes for each file or directory - an inode is a sort of storage bucket for all the file or folder attributes, such as file type, size, access permissions, modification dates, etc.
The Windows file system is built quite differently.
There is a lot more to it than just these, but there are significant differences between the way the Linux file system works, and the way the Windows file system works.
So WSL has to provide an interface between the way the linux environment expects to interact with the file system, and the actual Windows file system.
There is a bit of information on the internet about this, and it appears that WSL also uses a Virtual File System layer, but it is not the same as a normal Linux VFS layer.
It appears to use another layer called VoIS, and it is this layer that Linux "sees" as containing the Linux file system - VoIS also contains its own version of inodes to contain the file permissions.
But on top of that, the way that Windows does access control for files and folders is quite different from the way that Linux does, so again, the WSL has to try and translate file and folder permissions between the two systems.
It isn`t always successful - even from my fairly limited experimentation, it appears that there are problems with this.
For a start, how the Linux permissions work are affected by how you run the Bash shell - when you run the Bash shell you are in a Windows environment, and it makes a difference to the way the Bash shell treats permissions as to whether you run it as the normal Windows user, or whether you run it using the "Run as administrator" option.
Using Windows file explorer you can see into some of the Linux folders that you can`t see into from within the Bash shell, because there have been no Linux style permissions set on them.
There are some differences in the view of the Windows file system that the Windows file explorer provides, compared to the view that the Bash shell provides.
Another problem that is reported on the internet is case - Linux is case sensitive - a file called "read-me" is a different file to one called "Read-Me".
In Windows, case is preserved, but not differentiated, so "read-me" and "Read-Me" are the same file.
I think that I am right in saying that the Windows kernel has the capability to differentiate on the basis of case, but it isn`t enabled.
Another problem is that Windows is more restrictive in what characters can be used in file and folder names than Linux is - Linux has few restrictions on the characters that can be used. So it appears that VoIS deals with this by escaping the characters that Windows regards as illegal.
There isn`t a full inter-operability between Windows and the Bash shell within the file system, and if Windows is used to add a file within the Linux directory structure, the VoIS inode will not exist, and Linux may not see the file.
As already noted above, the Linux file system is actually stored within the Windows file system.
Now for some reason Microsoft decided that the WSL environment should be associated with a specific user, and the Linux file system is stored within the home directory of the user who installed it.
So if another user on the same computer also wants to use the Bash shell environment, they will have to install it for themselves.
There is quite a bit of variation on the internet about where in the home directory it is stored - on my laptop the path is C:\Users\<Username>\AppData\Local\lxss\
WSL does not contain or provide a Linux kernel for the Bash shell to use, instead the Linux syscalls are processed by drivers provided by WSL - lxss.sys and lxcore.sys - and they emulate a Linux kernel.
The Microsoft documentation on the internet talks about Pico processes as part of the mechanism that does this emulation, but I haven`t really got an understanding of what they are.
It appears that Windows processes and Linux processes are separate - Process Explorer shows Windows processes, the Bash shell shows Linux processes, and I don`t think there is a cross-over, although in Process Explorer you can see the processor time used by the Windows host process for Bash.
Thankfully, Microsoft decided not to provide Bash on Ubuntu on Windows by default - as there are quite a few security implications that arise from its installation.
One of them is that by switching to developer mode, you are allowing Windows to install all kinds of crappy and unsafe apps.
Having a Bash shell increases the attack surface of the computer, as the Bash shell has wide access to the Windows file system.
It could be argued that it is a bad idea that the Linux username and password are retained on the computer so that you don`t have to authenticate to run the Bash shell - but I can see the annoyance factor if you had to login everytime you opened the bash shell.
On the other hand, the fact that WSL isn`t installed by default means that if an outside hacker finds a Bash shell on the computer, then he can be reasonably sure that the computer is used by someone who has a significant role in system design or system maintenance, and the computer may well be a very powerful gateway into a wider system. So it is a bit of a giveaway.
At the present time I am afraid that I just don`t understand why Microsoft has decided to embrace Linux - over the last few years Microsoft has been moving into the open source world, maybe their move into Linux is entirely logical and altruistic. Or maybe it isn`t.
Microsoft have recently paid a lot of money - a lot of money - to become a Platinum Member of the Linux Foundation - they are going to have a strong voice in the way Linux develops - I am concerned about what it means for the future of Linux.
Microsoft have shown very strongly that they are totally fixated on the concept that they should be extracting every little bit of data about how users use Windows, and everything they do on it. Are they going to push Linux down the same road ?
Linux is built on a huge number of manhours of time given freely by volunteers - what impact on this will there be if Microsoft start calling the shots ?
The Linux world is going to change - I am not sure if it is going to be for the better.
Now I am not a developer, I wouldn`t know where to begin with cross platform development, and I have only played around with this incarnation of the Bash shell - but I don`t understand what the purpose is of this Bash on Ubuntu on Windows.
It isn`t proper Linux, it is a kid-on Linux -
Now if Microsoft want to embrace Linux and merge it into Windows, it might be possible to create a Linux partition, install a full version of Linux, and then devise a way to share hardware, and to switch between the Windows desktop and the Linux desktop.
Maybe WSL will develop and expand, but at the moment, if I had a need to have a Windows environment and a Linux environment on the same computer, I would set up a dual-booting machine rather than use this Bash on Ubuntu on Windows.
The cynic in me wonders if maybe Microsoft are scared to give Windows users the ability to use a proper version of Linux, because these same users might decide that Linux is better than Windows and start walking.