Wednesday, 6 September 2017

Windows Sub-system for linux

Windows Sub-system for Linux (WSL) was released about a year ago as a new feature for Windows 10 64-bit.  It is the result of a partnership between Canonical (makers of Ubuntu) and Microsoft. WSL implements a linux userspace which is based on Ubuntu linux binaries. So the file system (/usr, /lib, /home etc) is very familiar and you can use linux commands (cp, grep, apt, gcc).  When you first enable WSL you run apt-get update && apt-get upgrade and install other packages just as you would on any other system.
Win10 provides the kernel functions, Microsoft don't use the linux kernel, instead the Windows kernel is invoked to carry out those activities.  This means the overheads are much lower than those provided by a Virtual Machine which needs a linux kernel and an extra layer of software to translate to Windows.  On the downside, any kernel functions that Microsoft haven't implemented can't be used.
WSL is intended to provide linux command line rather than a graphical interface. You access WSL by starting a bash shell, a very similar experience to opening a cmd command prompt.  You can then use bash and linux functions as normal (using exe's provided by Canonical).  You can access and write to Windows using mount point /mnt/c.  You have your own copy of the linux filesystem in appdata/lxss/... but you should not write from Windows into the linux filesystem.
Installation is just a matter of enabling the WSL feature.
A very informative 20 minute video by Scott Hanselman provides all you need to know to get started.

No comments:

Post a Comment