Windows Subsystem for Linux

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Windows Subsystem for Linux
A component of Microsoft Windows
Ubuntu on Windows 10 - bash.png
Bash running on Windows 10
Details
Type Compatibility layer
Included with Windows 10 version 1607 and later
Replaces Windows Services for UNIX

Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10 and Windows Server 2019.

Overview

WSL provides a Linux-compatible kernel interface developed by Microsoft (containing no Linux kernel code),[1] which can then run a GNU user space on top of it, such as that of Ubuntu,[2][3][4][5] openSUSE,[6] SUSE Linux Enterprise Server,[7][8][9] Debian[10] and Kali Linux.[11] Such a user space might contain a Bash shell and command language, with native GNU/Linux command-line tools (sed, awk, etc.), programming language interpreters (Ruby, Python, etc.), and even graphical applications (using a X11 server at the host side).[12]

It can be considered as the Wine counterpart.

Introduction and availability

When introduced with the Anniversary Update, only an Ubuntu image was available. The Fall Creators Update moved the installation process for Linux distributions to the Windows Store, and introduced Fedora and SUSE images.[9]

WSL is available only in 64 bit versions of Windows 10 from version 1607. It is also available in Windows Server 2019.

Development

Microsoft's first foray into achieving Unix-like compatibility on Windows began with the Microsoft POSIX Subsystem, superseded by Windows Services for UNIX via MKS/Interix, which was eventually deprecated with the release of Windows 8.1. The technology behind Windows Subsystem for Linux originated in the unreleased Project Astoria, which enabled some Android applications to run on Windows 10 Mobile.[13] It was first made available in Windows 10 Insider Preview build 14316.[14]

Whereas Microsoft's previous projects and the third-party Cygwin had focused on creating their own unique Unix-like environments based on the POSIX standard, WSL aims for native Linux compatibility. Instead of wrapping non-native functionality into Win32 system calls, WSL leverages the NT kernel executive to serve Linux programs as special, isolated minimal processes (known as "pico-processes") attached to kernel-mode "pico-providers" as dedicated system call and exception handlers distinct from that of a vanilla NT process.[15]

Microsoft envisages WSL as "primarily a tool for developers – especially web developers and those who work on or with open source projects".[12] WSL uses fewer resources than a fully virtualized machine, the most direct way to run Linux software in a Windows environment, while also allowing users to use Windows apps and Linux tools on the same set of files.[12]

Architecture

LXSS Manager Service is the service in charge of interacting with the subsystem (through the drivers lxss.sys and lxcore.sys), and the way how Bash.exe (not to be confused with the Shells provided by the Linux distributions) launches the Linux processes, as well as handling the Linux system calls and the binary locks during their execution.[16]

All Linux processes invoked by a particular user go into a "Linux Instance" (usually, the first invoked process is init). Once all the applications are closed, the instance is closed.

Hardware and filesystem access

As there is no hardware emulation / virtualization (unlike other projects such as coLinux), WSL makes direct use of the host file system (through VolFS and DrvFS)[17] and some parts of the hardware, such as the network (web servers for example, can be accessed through the same interfaces and IP addresses configured on the host, and shares the same restrictions on the use of ports that require administrative permissions, or ports already occupied by other applications), which guarantees interoperability.[18]

There are certain locations (such as system folders) and configurations whose access/modification is restricted, even running sudo from the shell. An instance with elevated privileges must be launched in order to get a "real sudo" and allow such access.[12]

Limitations

This subsystem is not capable of running all Linux software, such as 32-bit binaries,[19][20] or those that require specific Linux kernel services not implemented in WSL. Since there is no "real" Linux kernel in WSL, kernel modules, such as device drivers, for Linux can't be run.

It is possible to run some graphical (GUI) applications (such as Mozilla Firefox) by installing an X11 server within the Windows (host) environment (such as VcXsrv or Xming), [21] although not without caveats, such as the lack of audio support or hardware acceleration (resulting in poor graphics performance). Support for OpenCL and CUDA is also not being implemented currently, although planned for future releases.[22][23]

That said, Microsoft explicitly states that WSL is oriented to the development of applications, and not for desktop environment or production servers, recommending the use of virtual machines (Hyper-V or Kubernetes) and Azure for those purposes.[12]

Benchmarks

In benchmarks Windows Subsystem for Linux is often near native Linux Ubuntu, Debian, Intel Clear Linux or other Linux distributions. I/O is in some tests a bottleneck for WSL.[24] [25]

Screenshots

See also

References

  1. ^ Gerwitz, Mike. "GNU/kWindows". mikegerwitz.com. Retrieved 2018-04-08.
  2. ^ Harsh, Mike (30 March 2016). "Run Bash on Ubuntu on Windows". Building Apps for Windows. Microsoft.
  3. ^ Finley, Klint (30 March 2016). "Why Microsoft Making Linux Apps Run on Windows Isn't Crazy". Wired. Condé Nast.
  4. ^ Kirkland, Dustin (30 March 2016). "Ubuntu on Windows – The Ubuntu Userspace for Windows Developers". Ubuntu Insights. Canonical.
  5. ^ Hammons, Jack (9 April 2016). "Bash on Ubuntu on Windows". MSDN. Microsoft.
  6. ^ Get openSUSE Leap 42 - Microsoft Store
  7. ^ Get SUSE Linux Enterprise Server 12 - Microsoft Store
  8. ^ Yegulalp, Serdar (2017-05-12). "Windows Subsystem for Linux welcomes Suse and Fedora options". InfoWorld. Retrieved 2017-09-16.
  9. ^ a b "Ubuntu now available from the Windows Store!". Windows Command Line Tools For Developers Blog. July 10, 2017. Retrieved 2017-08-11.
  10. ^ "Debian GNU/Linux for WSL now available in the Windows Store". Windows Command Line Tools For Developers. Retrieved 2018-03-07.
  11. ^ "Kali Linux in the Windows App Store". Retrieved 2018-03-09.
  12. ^ a b c d e "Frequently Asked Questions for WSL". Microsoft. Retrieved 2016-11-13.
  13. ^ Bright, Peter (6 April 2016). "Why Microsoft needed to make Windows run Linux software". Ars Technica. Condé Nast.
  14. ^ Aul, Gabe (6 April 2016). "Announcing Windows 10 Insider Preview Build 14316". Windows Experience Blog. Microsoft.
  15. ^ "Windows Subsystem for Linux Overview". Windows Subsystem for Linux. Retrieved 2018-04-22.
  16. ^ Jack Hammons (April 22, 2016). "Windows Subsystem for Linux Overview". Windows Subsystem for Linux blog on MSDN.
  17. ^ Jack Hammons (June 15, 2016). "WSL File System Support". Windows Subsystem for Linux blog on MSDN.
  18. ^ Jack Hammons (November 8, 2016). "WSL Networking". Windows Subsystem for Linux blog on MSDN.
  19. ^ "Please enable WSL to run 32 bit ELF binaries". Windows Developer feedback (Microsoft/UserVoice).
  20. ^ "Support for 32-bit i386 ELF binaries". GitHub.
  21. ^ "Windows 10's Bash shell can run graphical Linux applications with this trick". PC World. Retrieved September 10, 2018.
  22. ^ "GPU not accesssible for running tensorflow and installing CUDA · Issue #1788 · Microsoft/WSL". GitHub. Retrieved September 10, 2018.
  23. ^ "OpenCL & CUDA GPU support". Windows Developer feedback (Microsoft/UserVoice). September 15, 2016. Retrieved September 10, 2018.
  24. ^ "Windows Subsystem for Linux". Phoronix.
  25. ^ Michael Larabel (October 12, 2018). "A Look At The Windows 10 October 2018 Update Performance With WSL". Phoronix.

External links

  • Windows Subsystem for Linux blog
  • WSL on Microsoft Docs
  • WSL on GitHub
  • Windows Command Line Tools For Developers blog
  • Brown, Pete (22 July 2016). "Fun with the Windows Subsystem for Linux". Windows Developer Blog. Microsoft.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Windows_Subsystem_for_Linux&oldid=865328504"
This content was retrieved from Wikipedia : http://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
This page is based on the copyrighted Wikipedia article "Windows Subsystem for Linux"; it is used under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC-BY-SA). You may redistribute it, verbatim or modified, providing that you comply with the terms of the CC-BY-SA