This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these messages)
|
Other names | WSL |
---|---|
Developer(s) | Microsoft |
Initial release | 2 August 2016 |
Stable release | 2.3.26 / 10 November 2024 [1] |
Repository | github |
Operating system | Windows 10, Windows 10 LTSB/LTSC, Windows Server 2016, Windows Server 2019, Windows 11, Windows Server 2022, Windows Server 2025 |
Predecessor | Windows Services for UNIX |
Type | Compatibility layer, virtualization |
License | Subsystem: Proprietary commercial software; Linux kernel: GNU GPLv2 (only) with some code under compatible GPL variants or under permissive licenses like BSD, MIT |
Website | learn |
Windows Subsystem for Linux (WSL) is a feature of Microsoft Windows that allows for using a Linux environment without the need for a separate virtual machine or dual booting. WSL is installed by default in Windows 11. [2] In Windows 10, it can be installed either by joining the Windows Insider program or manually via Microsoft Store or Winget. [3]
The original version, WSL 1, differs significantly from the second major version, WSL 2. WSL 1 (released August 2, 2016), acted as a compatibility layer for running Linux binary executables (in ELF format) by implementing Linux system calls in the Windows kernel. [4] WSL 2 (announced May 2019 [5] ), introduced a real Linux kernel – a managed virtual machine (via Hyper-V technology) that implements the full Linux kernel. As a result, WSL 2 is compatible with more Linux binaries as not all system calls were implemented in WSL 1. [6]
Microsoft offers WSL for a variety of reasons. Microsoft envisions WSL as "a tool for developers – especially web developers and those who work on or with open source projects". [7] Microsoft also claims that "WSL requires fewer resources (CPU, memory, and storage) than a full virtual machine" (a common alternative for using Linux in Windows), while also allowing the use of both Windows and Linux tools on the same set of files. [7]
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. [8] It was first made available in Windows 10 Insider Preview build 14316. [9]
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 as Cygwin did, WSL's initial design (WSL 1) leveraged 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, opting to reutilize existing NT implementations wherever possible. [10]
WSL beta was introduced in Windows 10 version 1607 (Anniversary Update) on August 2, 2016. Only Ubuntu (with Bash as the default shell) was supported. WSL beta was also called "Bash on Ubuntu on Windows" or "Bash on Windows". WSL was no longer beta in Windows 10 version 1709 (Fall Creators Update), released on October 17, 2017. Multiple Linux distributions could be installed and were available for install in the Windows Store. [11]
In 2017 Richard Stallman expressed fears that integrating GNU functionality into Windows will only hinder the development of free software, calling efforts like WSL "a step backward in the campaign for freedom." [12]
Though WSL (via this initial design) was much faster and arguably much more popular than the previous UNIX-on-Windows projects, Windows kernel engineers found difficulty in trying to increase WSL's performance and syscall compatibility by trying to reshape the existing NT kernel to recognize and operate correctly on Linux's API. At a Microsoft Ignite conference in 2018, Microsoft engineers gave a high-level overview of a new "lightweight" Hyper-V VM technology for containerization where a virtualized kernel could make direct use of NT primitives on the host. [13] In 2019, Microsoft announced a completely redesigned WSL architecture (WSL 2) using this lightweight VM technology hosting actual (customized) Linux kernel images, claiming full syscall compatibility. [6] Microsoft announced WSL 2 on May 6, 2019, [5] and it was shipped with Windows 10 version 2004. [14] It was also backported to Windows 10 version 1903 and 1909. [15]
GPU support for WSL 2 to run GPU-accelerated machine learning was introduced in Windows build 20150. [16] GUI support for WSL 2 to run Linux applications with graphical user interfaces (GUIs) was introduced in Windows build 21364. [17] Both of them are shipped in Windows 11.
In April 2021, Microsoft released a Windows 10 test build that also includes the ability to run Linux graphical user interface (GUI) apps using WSL 2 and CBL-Mariner. [18] [17] The Windows Subsystem for Linux GUI (WSLg) was officially released at the Microsoft Build 2021 conference. It is included in Windows 10 Insider build 21364 or later. [19]
Microsoft introduced a Microsoft Store version of WSL on October 11, 2021, for Windows 11. [20] It reached version 1.0.0 on November 16, 2022 with added support for Windows 10.
Release / Feature | Preview build | Public build |
---|---|---|
WSL (Beta) (Bash on Ubuntu on Windows) | Windows 10 build 14316 | Windows 10 version 1607 (Anniversary Update) |
WSL (no longer Beta) | Windows 10 build 16251 | Windows 10 version 1709 (Fall Creators Update) |
WSL 2 (lightweight VM) | Windows 10 build 18917 | Windows 10 version 2004 (also backported to 1903 and 1909) |
WSL 2 GPU support | Windows 10 build 20150 | Windows 11 (also Windows 10 21H2) |
WSL 2 GUI support (WSLg) (last version) | Windows 10 build 21364 | Windows 11 |
Version | Comment |
---|---|
0.47.1 | First version |
0.67.6 | systemd support |
1.0.0 | Generally available; Windows 10 support |
The first release of WSL provides a Linux-compatible kernel interface developed by Microsoft, containing no Linux kernel code, which can then run the user space of a Linux distribution on top of it, such as Ubuntu, [21] [22] [23] [24] openSUSE, [25] SUSE Linux Enterprise Server, [26] [27] [11] Debian [28] and Kali Linux. [29] Such a user space might contain a GNU Bash shell and command language, with native GNU command-line tools (sed, awk, etc.), programming-language interpreters (Ruby, Python, etc.), and even graphical applications (using an X11 server at the host side). [7]
The architecture was redesigned in WSL 2, [5] with a Linux kernel running in a lightweight virtual machine environment.
The wsl.exe
command accesses and manages Linux distributions in WSL via command-line interface (CLI) – for example via Command Prompt or PowerShell. With no arguments it enters the default distribution shell. It can list available distributions, set a default distribution, and uninstall distributions. [30] It can also run a Linux command [31] – replacing lxrun.exe
which is deprecated as of Windows 10 1803 and later. [32]
Windows Subsystem for Linux GUI (WSLg) is built with the purpose of enabling support for running Linux GUI applications (X11 and Wayland) on Windows in a fully integrated desktop experience. [33] WSLg was officially released at the Microsoft Build 2021 conference and is included in Windows 10 Insider build 21364 or later. [19] However, with the introduction of Windows 11, WSLg is finally shipping with a production build of Windows, bringing support for both graphics and audio in WSL apps. [34] FreeRDP is used to encode all communications going from the Remote Desktop Protocol (RDP) Server (in Weston) to the RDP Client (msrdc on Windows [35] ) according to the RDP protocol specifications. [36]
Prerequisites for running WSLg include:
LXSS Manager Service is the service in charge of interacting with the subsystem (through the drivers lxss.sys
and lxcore.sys
), and the way that Bash.exe (not to be confused with the Shells provided by the Linux distributions) launches the processes, as well as handling the Linux system calls and the binary locks during their execution. [38] All processes invoked by a particular user go into a so called "Linux Instance" (usually the first invoked process is init). Once all the applications are closed, the instance is closed.
WSL 1's design featured no hardware emulation / virtualization (unlike other projects such as coLinux) and makes direct use of the host file system (through VolFS
and DrvFS
) [39] and some parts of the hardware, such as the network, which guarantees interoperability. 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. [40] There are certain locations (such as system folders) and configurations whose access/modification is restricted, even when running as root, with sudo from the shell. An instance with elevated privileges must be launched in order to get "sudo" to give administrator privileges, and allow such access. [7]
WSL 1 is not capable of running all Linux software, such as 32-bit binaries, [41] [42] or those that require specific Linux kernel services not implemented in WSL. Due to a total lack of Linux in WSL 1, kernel modules, such as device drivers, cannot be run. WSL 2, however, makes use of live virtualized Linux kernel instances. 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), [43] although not without caveats, such as the lack of audio support (though this can be remedied by installing PulseAudio in Windows in a similar manner to X11) or hardware acceleration (resulting in poor graphics performance). Support for OpenCL and CUDA is also not being implemented currently, although planned for future releases. [44] [45] Microsoft stated WSL was designed for the development of applications, and not for desktop computers or production servers, recommending the use of virtual machines (Hyper-V), Kubernetes, and Azure for those purposes. [7]
In benchmarks, WSL 1's performance is often near native Linux Ubuntu, Debian, Intel Clear Linux or other Linux distributions. I/O is in some tests a bottleneck for WSL. [46] [47] [48] The redesigned WSL 2 backend is claimed by Microsoft to offer twenty-fold increases in speed on certain operations compared to that of WSL 1. [6] In June 2020, a benchmark with 173 tests on WSL 2 (20H2) with an AMD Ryzen Threadripper 3970X showed an average of 87% of the performance of native Ubuntu 20.04 LTS. In contrast, WSL 1 had only 70% of the performance of native Ubuntu. WSL 2 improves I/O performance, providing a near-native level. [49] A comparison of 69 tests with an Intel Core i9-10900K in May 2020 resulted in nearly the same relative performance. [50] In December 2020, a benchmark with 43 tests on WSL 2 (20H2) with an AMD Ryzen 9 5900X displayed an average of 93% of the performance of native 20.04.1 LTS, compared to WSL 1 which only achieved 73%. [51]
Version 2 introduces changes in the architecture. Microsoft has opted for virtualization through a highly optimized subset of Hyper-V features, in order to run the kernel and distributions (based upon the kernel), promising performance equivalent to WSL 1. For backward compatibility, developers do not need to change anything in their published distributions. WSL 2 settings can be tweaked by the WSL global configuration, contained in an INI file named .wslconfig
in the User Profile folder. [52] [53]
The distribution installation resides inside an ext4-formatted filesystem inside a virtual disk, and the host file system is transparently accessible through the 9P protocol, [54] similarly to other virtual machine technologies like QEMU. [55] For the users, Microsoft promised up to 20 times the read/write performance of WSL 1. [5] From Windows an IFS network redirector is provided for Linux guest file access using the UNC path prefix of \\wsl$
.
WSL 2 requires Windows 11, [56] or Windows 10 version 1903 or higher, with Build 18362 or higher, for x64 systems, and Version 2004 or higher, with Build 19041 or higher, for ARM64 systems. [3]
WSL 2 on Windows 11 retains 95% of the performance of native Ubuntu 20.04 LTS. [57]
WSL 1 does not support IPv6 connections, whereas WSL 2 does. [58] [59] IPv6 support in WSL 2 requires Windows 11 or newer. [60]
Wine is a free and open-source compatibility layer to allow application software and computer games developed for Microsoft Windows to run on Unix-like operating systems. Developers can compile Windows applications against WineLib to help port them to Unix-like systems. Wine is predominantly written using black-box testing reverse-engineering, to avoid copyright issues. No code emulation or virtualization occurs. Wine is primarily developed for Linux and macOS.
Gambas is the name of an object-oriented dialect of the BASIC programming language, as well as the integrated development environment that accompanies it. Designed to run on Linux and other Unix-like computer operating systems, its name is a recursive acronym for Gambas Almost Means Basic. Gambas is also the word for prawns in the Spanish, French, and Portuguese languages, from which the project's logos are derived.
X.Org Server is the free and open-source implementation of the X Window System (X11) display server stewarded by the X.Org Foundation.
Ubuntu is a Linux distribution derived from Debian and composed mostly of free and open-source software. Ubuntu is officially released in multiple editions: Desktop, Server, and Core for Internet of things devices and robots. The operating system is developed by the British company Canonical and a community of other developers, under a meritocratic governance model. As of October 2024, the latest interim release is 24.10, with most-recent long-term support release is 24.04.
The Direct Rendering Manager (DRM) is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards. DRM exposes an API that user-space programs can use to send commands and data to the GPU and perform operations such as configuring the mode setting of the display. DRM was first developed as the kernel-space component of the X Server Direct Rendering Infrastructure, but since then it has been used by other graphic stack alternatives such as Wayland and standalone applications and libraries such as SDL2 and Kodi.
Mesa, also called Mesa3D and The Mesa 3D Graphics Library, is an open source implementation of OpenGL, Vulkan, and other graphics API specifications. Mesa translates these specifications to vendor-specific graphics hardware drivers.
A free and open-source graphics device driver is a software stack which controls computer-graphics hardware and supports graphics-rendering application programming interfaces (APIs) and is released under a free and open-source software license. Graphics device drivers are written for specific hardware to work within a specific operating system kernel and to support a range of APIs used by applications to access the graphics hardware. They may also control output to the display if the display driver is part of the graphics hardware. Most free and open-source graphics device drivers are developed by the Mesa project. The driver is made up of a compiler, a rendering API, and software which manages access to the graphics hardware.
A kernel is a component of a computer operating system. A comparison of system kernels can provide insight into the design and architectural choices made by the developers of particular operating systems.
ext4 is a journaling file system for Linux, developed as the successor to ext3.
nouveau is a free and open-source graphics device driver for Nvidia video cards and the Tegra family of SoCs written by independent software engineers, with minor help from Nvidia employees.
The Linux kernel is a free and open source, UNIX-like kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the kernel for the GNU operating system (OS) which was created to be a free replacement for Unix. Since the late 1990s, it has been included in many operating system distributions, many of which are called Linux. One such Linux kernel operating system is Android which is used in many mobile and embedded devices.
Nvidia Optimus is a computer GPU switching technology created by Nvidia which, depending on the resource load generated by client software applications, will seamlessly switch between two graphics adapters within a computer system in order to provide either maximum performance or minimum power draw from the system's graphics rendering hardware.
Alpine Linux is a Linux distribution designed to be small, simple, and secure. It uses musl, BusyBox, and OpenRC instead of the more commonly used glibc, GNU Core Utilities, and systemd. This makes Alpine one of few Linux distributions not to be based on the GNU Core Utilities.
Microsoft Build is an annual conference event held by Microsoft, aimed at software engineers and web developers using Windows, Microsoft Azure and other Microsoft technologies. First held in 2011, it serves as a successor for Microsoft's previous developer events, the Professional Developers Conference and MIX. The attendee price was (US)$2,195 in 2016, up from $2,095 in 2015. It sold out quickly, within one minute of the registration site opening in 2016.
mpv is free and open-source media player software based on MPlayer, mplayer2 and FFmpeg. It runs on several operating systems, including Unix-like operating systems and Microsoft Windows, along with having an Android port called mpv-android. It is cross-platform, running on ARM, MIPS, PowerPC, RISC-V, s390x, x86/IA-32, x86-64, and some other by 3rd party.
Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. The service has both free and premium tiers. The software that hosts the containers is called Docker Engine. It was first released in 2013 and is developed by Docker, Inc.
Snap is a software packaging and deployment system developed by Canonical for operating systems that use the Linux kernel and the systemd init system. The packages, called snaps, and the tool for using them, snapd, work across a range of Linux distributions and allow upstream software developers to distribute their applications directly to users. Snaps are self-contained applications running in a sandbox with mediated access to the host system. Snap was originally released for cloud applications but was later ported to also work for Internet of Things devices and desktop applications.
Microsoft, a tech company historically known for its opposition to the open source software paradigm, turned to embrace the approach in the 2010s. From the 1970s through 2000s under CEOs Bill Gates and Steve Ballmer, Microsoft viewed the community creation and sharing of communal code, later to be known as free and open source software, as a threat to its business, and both executives spoke negatively against it. In the 2010s, as the industry turned towards cloud, embedded, and mobile computing—technologies powered by open source advances—CEO Satya Nadella led Microsoft towards open source adoption although Microsoft's traditional Windows business continued to grow throughout this period generating revenues of 26.8 billion in the third quarter of 2018, while Microsoft's Azure cloud revenues nearly doubled.
Azure Linux, previously known as CBL-Mariner, is a free and open-source Linux distribution that Microsoft has developed. It is the base container OS for Microsoft Azure services and the graphical component of WSL 2.
{{cite web}}
: CS1 maint: numeric names: authors list (link)In this new update we've added the ability to start using global config options for WSL. These options are targeted towards power users who want to further customize their WSL experience.