Windows Subsystem for Linux#See also

{{Short description|Feature for a Linux environment in Windows}}

{{Use dmy dates|date=February 2019}}

{{Infobox software

| name = Windows Subsystem for Linux

| logo = Windows_Subsystem_for_Linux_logo.png

| logo_size = 64px

| screenshot = Ubuntu on Windows 10 - bash.png

| screenshot_size = 300px

| caption = Bash running on Windows 10

| other_names = WSL

| developer = Microsoft

| released = {{sda|2016|08|02|df=y}}

| latest release version = 2.4.10

| latest release date = {{sda|2025|02|02|df=y}}{{Cite web

| url = https://github.com/microsoft/WSL/releases/tag/2.4.10

| title = Release 2.4.10 · microsoft/WSL

| website = GitHub

| date = 2025-02-02

| access-date = 2025-02-06}}

| latest preview version = 2.4.9

| latest preview date = {{Start date and age|2025|01|30}}{{Cite web |title=Release 2.4.9 · microsoft/WSL |url=https://github.com/microsoft/WSL/releases/tag/2.4.9 |access-date=2025-02-06 |website=GitHub |language=en}}

| repo = {{URL|https://github.com/microsoft/WSL2-Linux-Kernel}}

| replaces = Windows Services for UNIX

| operating system = Windows 11, Windows 10, Windows 10 LTSB/LTSC, Windows Server 2025, Windows Server 2022, Windows Server 2019, Windows Server 2016

| genre = 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 = {{URL|https://learn.microsoft.com/windows/wsl}}

}}

Windows Subsystem for Linux (WSL) is a feature of Microsoft Windows that allows the use of a GNU/Linux environment from within Windows, foregoing the overhead of a virtual machine and being an alternative to dual booting. The WSL command-line interface tool is installed by default in Windows 11, but a distribution must be downloaded and installed through it before use.{{Cite web |date=19 November 2024 |title=How to install Linux on Windows with WSL |url=https://learn.microsoft.com/en-us/windows/wsl/install |access-date=2025-02-25 |website=Microsoft |language=en}} In Windows 10, WSL can be installed either by joining the Windows Insider program or manually via Microsoft Store or Winget.{{Cite web |last=pokhrel |first=bishal |date=2023-12-27 |title=Install WSL on Windows 10 or 11 |url=https://droidcrafts.com/how-to-enable-wsl-and-install-linux-on-windows/ |website=Droid Crafts |language=en-us}}

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.{{Cite book |last=Leeks |first=Stuart |url=https://www.worldcat.org/oclc/1202451000 |title=Windows Subsystem for Linux 2 (WSL 2) Tips, Tricks, and Techniques: Maximise Productivity of Your Windows 10 Development Machine with Custom Workflows and Configurations |date=2020 |publisher=Packt Publishing |isbn=978-1-80056-352-0 |location=Birmingham |pages=18–19 |oclc=1202451000}} WSL 2 (announced May 2019{{cite web|url=https://devblogs.microsoft.com/commandline/announcing-wsl-2/|title=Announcing WSL 2|author=Craig Loewen|date=2019-05-06|website=Windows Command Line Tools For Developers}}), introduced a real Linux kernel {{endash}} a managed virtual machine (via Hyper-V) 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.{{cite web|url=https://docs.microsoft.com/en-us/windows/wsl/wsl2-about|title=About WSL 2|website=docs.microsoft.com|author=mscraigloewen|date=19 November 2024 }}

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". 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.

History

Microsoft's first foray into achieving Unix-like compatibility on Windows was 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.{{cite web|url=https://arstechnica.com/information-technology/2016/04/why-microsoft-needed-to-make-windows-run-linux-software/|title=Why Microsoft needed to make Windows run Linux software|last1=Bright|first1=Peter|date=6 April 2016|website=Ars Technica|publisher=Condé Nast}} It was first made available in Windows 10 Insider Preview build 14316.{{cite web|last1=Aul|first1=Gabe|title=Announcing Windows 10 Insider Preview Build 14316|url=https://blogs.windows.com/windowsexperience/2016/04/06/announcing-windows-10-insider-preview-build-14316/|website=Windows Experience Blog|publisher=Microsoft|date=6 April 2016}}

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 aimed for native Linux compatibility.{{cn|date=March 2025}} 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.{{Cite news|url=https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview/|title=Windows Subsystem for Linux Overview|work=Windows Subsystem for Linux|access-date=22 April 2018|language=en-US}}

WSL beta was introduced in Windows 10 version 1607 (Anniversary Update) on August 2, 2016.{{cn|date=March 2025}} Only Ubuntu (with Bash as the default shell) was supported.{{cn|date=March 2025}} 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.{{cn|date=March 2025}} Multiple Linux distributions could be installed and were available for install in the Windows Store.{{cite web |url=https://devblogs.microsoft.com/commandline/whats-new-in-wsl-in-windows-10-fall-creators-update/ |title=What's new in WSL in Windows 10 Fall Creators Update - Windows Command Line |date=11 October 2017 |website=Windows Command Line |access-date=15 October 2021}}

Though the initial design of WSL was faster and more popular{{according to whom|date=March 2025}} than the previous UNIX-on-Windows projects, Windows kernel engineers found difficulty in trying to increase WSL's performance and system call compatibility by trying to reshape the existing NT kernel to recognize and operate correctly on Linux's API.{{cn|date=March 2025}} 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.{{Citation|last=Microsoft Ignite|title=OS internals: Technical deep-dive into operating system innovations - BRK3365|date=2018-10-02|url=https://www.youtube.com/watch?v=tG8R5SQGPck&t=24m50s| archive-url=https://ghostarchive.org/varchive/youtube/20211109/tG8R5SQGPck| archive-date=2021-11-09 | url-status=live|access-date=2019-05-07}}{{cbignore}} In 2019, Microsoft announced a completely redesigned WSL architecture (WSL 2) using this lightweight VM technology hosting actual (customized) Linux kernel images, claiming to provide full syscall compatibility. Microsoft announced WSL 2 on May 6, 2019, and it was shipped with Windows 10 version 2004.{{cite web |url=https://devblogs.microsoft.com/commandline/wsl2-will-be-generally-available-in-windows-10-version-2004/ |title=WSL 2 will be generally available in Windows 10, version 2004 - Windows Command Line |date=13 March 2020 |website=Windows Command Line |access-date=15 October 2021}} It was also backported to Windows 10 version 1903 and 1909.{{cite web |url=https://devblogs.microsoft.com/commandline/wsl-2-support-is-coming-to-windows-10-versions-1903-and-1909/ |title=WSL 2 Support is coming to Windows 10 Versions 1903 and 1909 - Windows Command Line |date=20 August 2020 |website=Windows Command Line |access-date=15 October 2021}}

GPU support for WSL 2 to run GPU-accelerated machine learning was introduced in Windows build 20150.{{cite web |url=https://blogs.windows.com/windowsdeveloper/2020/06/17/gpu-accelerated-ml-training-inside-the-windows-subsystem-for-linux/ |title=GPU accelerated ML training inside the Windows Subsystem for Linux - Windows Developer Blog |date=17 June 2020 |website=Windows Blog |access-date=16 October 2021}} GUI support for WSL 2 to run Linux applications with graphical user interfaces (GUIs) was introduced in Windows build 21364.{{cite web |url=https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/ |title=The Initial Preview of GUI app support is now available for the Windows Subsystem for Linux - Windows Command Line |date=21 April 2021 |website=Windows Command Line}} Both are shipped in Windows 11.{{cn|date=March 2025}}

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.{{Cite news|last=Foley|first=Mary Jo|date=2021-04-21|url=https://www.zdnet.com/article/new-windows-10-test-build-adds-first-preview-of-linux-gui-apps-on-wsl/|title=New Windows 10 test build adds first preview of Linux GUI apps on WSL|access-date=2021-04-23|website=ZDNet|language=en-US}} 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.{{Cite news|last=Abrams|first=Lawrence|date=2021-05-29|url=https://www.bleepingcomputer.com/news/microsoft/hands-on-with-wslg-running-linux-gui-apps-in-windows-10/|title=Hands on with WSLg: Running Linux GUI apps in Windows 10|access-date=2021-05-30|website=Bleeping Computer}}

On October 11, 2021, Microsoft introduced a version of WSL in the Microsoft Store for Windows 11.{{cite web |url=https://devblogs.microsoft.com/commandline/a-preview-of-wsl-in-the-microsoft-store-is-now-available/ |title=A preview of WSL in the Microsoft Store is now available! - Windows Command Line |date=11 October 2021 |website=Windows Command Line |access-date=16 October 2021}} It reached version 1.0.0 in November 2022 with added support for Windows 10.{{cn|date=March 2025}}

In November 2024, Microsoft announced new features coming to WSL intended to improve the experience for new users, including a window with new "getting started" navigation tips and explanations.{{Cite web |date=2024-11-19 |title=Microsoft Wants to Simplify the Windows Subsystem for Linux |url=https://tech.yahoo.com/general/articles/microsoft-wants-simplify-windows-subsystem-213721642.html |access-date=2025-03-30 |website=Yahoo Tech |language=en-US}}

= Notable releases =

class="wikitable"

|+ WSL as a Windows component

Release / FeaturePreview buildPublic build
WSL (Beta) (Bash on Ubuntu on Windows)Windows 10 build 14316Windows 10 version 1607 (Anniversary Update)
WSL (no longer Beta)Windows 10 build 16251Windows 10 version 1709 (Fall Creators Update)
WSL 2 (lightweight VM)Windows 10 build 18917Windows 10 version 2004 (also backported to 1903 and 1909)
WSL 2 GPU supportWindows 10 build 20150Windows 11 (also Windows 10 21H2)
WSL 2 GUI support (WSLg) (last version)Windows 10 build 21364Windows 11

class="wikitable"

|+ WSL as a Windows Store app

VersionComment
0.47.1First version
0.67.6systemd support
1.0.0Generally available; Windows 10 support

Features

file:Screenshot of ‘Bash on Ubuntu on Windows’.png running on Windows 10]]

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,{{cite web|last1=Harsh|first1=Mike|title=Run Bash on Ubuntu on Windows|url=https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/|website=Building Apps for Windows|publisher=Microsoft|date=30 March 2016}}{{cite web|last1=Finley|first1=Klint|title=Why Microsoft Making Linux Apps Run on Windows Isn't Crazy|url=https://www.wired.com/2016/03/microsoft-making-linux-apps-run-windows-isnt-crazy/|website=Wired|publisher=Condé Nast|date=30 March 2016}}{{Cite web|url=http://insights.ubuntu.com/2016/03/30/ubuntu-on-windows-the-ubuntu-userspace-for-windows-developers/|title=Ubuntu on Windows – The Ubuntu Userspace for Windows Developers|last=Kirkland|first=Dustin|date=30 March 2016|website=Ubuntu Insights|publisher=Canonical}}{{cite web|last1=Hammons|first1=Jack|title=Bash on Ubuntu on Windows|url=https://msdn.microsoft.com/en-us/commandline/wsl/about|website=MSDN|publisher=Microsoft|date=9 April 2016}} openSUSE,[https://www.microsoft.com/store/apps/9njvjts82tjx Get openSUSE Leap 42 - Microsoft Store] SUSE Linux Enterprise Server,[https://www.microsoft.com/store/apps/9p32mwbh6cns Get SUSE Linux Enterprise Server 12 - Microsoft Store]{{cite web|url=https://www.infoworld.com/article/3196284/linux/windows-subsystem-for-linux-welcomes-suse-and-fedora-options.html|website=InfoWorld|date=12 May 2017|access-date=16 September 2017|title=Windows Subsystem for Linux welcomes Suse and Fedora options|last=Yegulalp|first=Serdar}} Debian{{Cite news|url=https://blogs.msdn.microsoft.com/commandline/2018/03/06/debian-gnulinux-for-wsl-now-available-in-the-windows-store/|title=Debian GNU/Linux for WSL now available in the Windows Store|work=Windows Command Line Tools For Developers|access-date=7 March 2018|language=en-US}} and Kali Linux.{{Cite news|url=https://www.kali.org/news/kali-linux-in-the-windows-app-store/|title=Kali Linux in the Windows App Store|access-date=9 March 2018|language=en-US}} 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).{{cite web|title=Frequently Asked Questions for WSL|url=https://msdn.microsoft.com/en-us/commandline/wsl/faq|publisher=Microsoft|access-date=13 November 2016}}

The architecture was redesigned in WSL 2, with a Linux kernel running in a lightweight virtual machine environment.

= wsl.exe =

The wsl.exe command accesses and manages Linux distributions in WSL via command-line interface (CLI) {{endash}} 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.[https://docs.microsoft.com/en-us/windows/wsl/wsl-config Manage and configure Windows Subsystem for Linux] It can also run a Linux command[https://docs.microsoft.com/en-us/windows/wsl/interop Windows Subsystem for Linux interoperability with Windows] {{endash}} replacing lxrun.exe which is deprecated as of Windows 10 1803 and later.[https://docs.microsoft.com/de-de/windows/wsl/reference Command Reference for Windows Subsystem for Linux]

= WSLg =

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.{{Citation|title=Welcome to WSLg|date=2021-11-07|url=https://github.com/microsoft/wslg|publisher=Microsoft|access-date=2021-11-07}} WSLg was officially released at the Microsoft Build 2021 conference and is included in Windows 10 Insider build 21364 or later. 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.{{Cite web|last=Salter|first=Jim|date=2021-10-07|title=The best part of Windows 11 is a revamped Windows Subsystem for Linux|url=https://arstechnica.com/gadgets/2021/10/the-best-part-of-windows-11-is-a-revamped-windows-subsystem-for-linux/|access-date=2021-11-07|website=Ars Technica|language=en-us}} FreeRDP is used to encode all communications going from the Remote Desktop Protocol (RDP) Server (in Weston) to the RDP Client (msrdc on Windows{{Cite web |last=Viswav |first=Pradeep |date=2021-10-11 |title=Windows Subsystem for Linux (WSL) now available as an app from Microsoft Store on Windows 11 |url=https://mspoweruser.com/windows-subsystem-linux-microsoft-store-windows-11/ |access-date=2024-04-30 |website=MSPoweruser |language=en-US}}) according to the RDP protocol specifications.{{Cite web|date=2022-04-27|title=Installing WSLg|url=https://github.com/microsoft/wslg|access-date=2022-04-27|website=GitHub|language=en-us}}

Prerequisites for running WSLg include:

  • Windows 11 or Windows 10 Insider Preview builds 21362–21390.{{Cite web |title=Clarify Windows 10 vs 11 and build numbers (#485) · microsoft/wslg@5ddd8d2 |url=https://github.com/microsoft/wslg/commit/5ddd8d21538e584bdf43d79f9644c67ac95b6fa7 |access-date=2022-05-28 |website=GitHub |language=en}}
  • A system with virtual GPU (vGPU) enabled for WSL is recommended, as it will allow benefits from hardware accelerated OpenGL rendering.

Design

= WSL 1 =

file:WSL gui Firefox.png for Linux running on WSL]]

LXSS Manager Service is the service in charge of interacting with the subsystem (through the drivers {{code|lxss.sys}} and {{code|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.{{cite web|url=https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview|title=Windows Subsystem for Linux Overview|website=Windows Subsystem for Linux blog on MSDN|author=Jack Hammons|date=22 April 2016}} 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 made direct use of the host file system (through {{Code|VolFS}} and {{Code|DrvFS}}){{cite web|title=WSL File System Support|url=https://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support|website=Windows Subsystem for Linux blog on MSDN|author=Jack Hammons|date=15 June 2016}} 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.{{Cite web|url=https://blogs.msdn.microsoft.com/wsl/2016/11/08/225/|title=WSL Networking|website=Windows Subsystem for Linux blog on MSDN|author=Jack Hammons|date=8 November 2016}} 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.

WSL 1 is not capable of running all Linux software, such as 32-bit binaries,{{Cite web|url=https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13377507-please-add-32-bit-elf-support-to-the-kernel|title=Please enable WSL to run 32 bit ELF binaries|website=Windows Developer feedback (Microsoft/UserVoice)|access-date=21 January 2018|archive-date=23 August 2019|archive-url=https://web.archive.org/web/20190823033116/https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13377507-please-add-32-bit-elf-support-to-the-kernel|url-status=dead}}{{Cite web|url=https://github.com/Microsoft/WSL/issues/390|title=Support for 32-bit i386 ELF binaries|website=GitHub}} 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),{{Cite web|url=http://www.pcworld.com/article/3055403/windows/windows-10s-bash-shell-can-run-graphical-linux-applications-with-this-trick.html|title=Windows 10's Bash shell can run graphical Linux applications with this trick|access-date=10 September 2018|website=PC World}} 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.{{Cite web|url=https://github.com/Microsoft/WSL/issues/1788|title=GPU not {{as written|acces|ssible [sic]}} for running tensorflow and installing CUDA · Issue #1788 · Microsoft/WSL|access-date=10 September 2018|website=GitHub}}{{Cite web|title=OpenCL & CUDA GPU support|url=https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/16108045-opencl-cuda-gpu-support|date=15 September 2016|access-date=10 September 2018|website=Windows Developer feedback (Microsoft/UserVoice)|archive-date=7 July 2018|archive-url=https://web.archive.org/web/20180707230416/https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/16108045-opencl-cuda-gpu-support|url-status=dead}} 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.

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.{{cite web|url=https://www.phoronix.com/scan.php?page=search&q=Windows+Subsystem+for+Linux|title=Windows Subsystem for Linux|website=Phoronix}}{{cite web|url=https://www.phoronix.com/scan.php?page=article&item=windows10-okt-wsl&num=1|title=A Look At The Windows 10 October 2018 Update Performance With WSL|first=Michael|last=Larabel|date=12 October 2018|website=Phoronix}}{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=WSL-Improvements-Win10-Oct-2018|title=The WSL Improvements In The Windows 10 October 2018 Update|first=Michael|last=Larabel|date=5 November 2018|website=Phoronix}} 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. 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.{{cite web|url=https://www.phoronix.com/scan.php?page=article&item=wsl-wsl2-tr3970x&num=1|title=Ubuntu 20.04 vs. Windows 10 WSL/WSL2 Performance In 170+ Benchmarks|first=Michael|last=Larabel|date=24 June 2020|website=Phoronix}}

A comparison of 69 tests with an Intel Core i9-10900K in May 2020 resulted in nearly the same relative performance.{{cite web|url=https://www.phoronix.com/scan.php?page=article&item=windows10-may2020-wsl2&num=1|title=Windows 10 May 2020 Performance For WSL vs. WSL2|first=Michael|last=Larabel|date=17 June 2020|website=Phoronix}} 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%.{{cite web|url=https://www.phoronix.com/scan.php?page=article&item=wsl2-ryzen9-5900x&num=1|title=Windows Subsystem For Linux / WSL2 Performance With The AMD Ryzen 9 5900X|first=Michael|last=Larabel|date=16 December 2020|website=Phoronix}}

= WSL 2 =

file:WSL gui Synaptic.png running on WSL]]

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.{{ cite web | url = https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-insiders-preview-build-18945/ | title = What's new for WSL in Insiders Preview Build 18945 | access-date = 26 July 2019 | first = Craig | last = Loewen | date = 26 July 2019 | website = Microsoft devblog | quote = 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. | archive-url = https://web.archive.org/web/20190726201938/https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-insiders-preview-build-18945/ | archive-date = 26 July 2019 | df = dmy-all }}{{ cite web | url = https://github.com/MicrosoftDocs/WSL/releases/tag/18945 | title = MicrosoftDocs/WSL | Build 18947 | access-date = 26 July 2019 | first = Ben | last = Hillis | date = 25 July 2019 | website = GitHub | archive-date = 26 July 2019 | archive-url = https://web.archive.org/web/20190726202324/https://github.com/MicrosoftDocs/WSL/releases/tag/18945 | df = dmy-all }}

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,{{Cite web|url=https://devblogs.microsoft.com/commandline/a-deep-dive-into-how-wsl-allows-windows-to-access-linux-files/|title=A Deep Dive Into How WSL Allows Windows to Access Linux Files|date=2019-05-30|website=Windows Command Line Tools For Developers|language=en-US|access-date=2019-06-24}} similarly to other virtual machine technologies like QEMU.{{Cite journal|last1=Jujjuri|first1=Venkateswararao|last2=Van Hensbergen|first2=Eric|last3=Liguori|first3=Anthony|last4=Pulavarty|first4=Badari|date=July 13–16, 2010|title=VirtFS—A virtualization aware File System pass-through|url=https://www.kernel.org/doc/ols/2010/ols2010-pages-109-120.pdf|journal=Linux Symposium}} For the users, Microsoft promised up to 20 times the read/write performance of WSL 1. From Windows an IFS network redirector is provided for Linux guest file access using the UNC path prefix of \\wsl$.{{cn|date=March 2025}}

WSL 2 requires Windows 11,{{ Cite web|url=https://learn.microsoft.com/en-us/windows/wsl/compare-versions|title = Comparing WSL 1 and WSL 2|website=Microsoft Learn|date=2022-10-04|access-date=2022-10-18 }} 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.

WSL 2 on Windows 11 retains 95% of the performance of native Ubuntu 20.04 LTS.{{cite web |last=Larabel |first=Michael |date=29 September 2021 |title=Windows 11 WSL2 Performance is Quite Competitive Against Ubuntu 20.04 LTS / Ubuntu 21.10 |url=https://www.phoronix.com/review/windows11-wsl2-good |website=Phoronix}}

WSL 1 and WSL 2 both support IPv6 connections.{{Cite web |last=craigloewen-msft |date=2023-12-15 |title=Comparing WSL Versions |url=https://learn.microsoft.com/en-us/windows/wsl/compare-versions |access-date=2023-12-16 |website=learn.microsoft.com |language=en-us}}{{Cite web |last=craigloewen-msft |date=2023-07-31 |title=Accessing network applications with WSL |url=https://learn.microsoft.com/en-us/windows/wsl/networking#ipv6-access |access-date=2023-10-11 |website=learn.microsoft.com |language=en-us}} IPv6 support in WSL 2 requires Windows 11 or newer.{{Cite web |title=wsl: Hyper-V firewall is not supported wsl: Mirrored networking mode is not supported, falling back to NAT networking · Issue #10495 · microsoft/WSL |url=https://github.com/microsoft/WSL/issues/10495#issuecomment-1855059548 |access-date=2023-12-16 |website=GitHub |language=en}}

Reception and criticism

In 2017 Richard Stallman expressed concerns that integrating GNU functionality into Windows would hinder the development of free software, calling efforts like WSL "a step backward in the campaign for freedom."{{ cite web | url = https://www.techrepublic.com/article/will-microsoft-love-linux-to-death-shuttleworth-and-stallman-on-whether-windows-10-is-free-softwares/ | title = Will Microsoft love Linux to death? Shuttleworth and Stallman on whether Windows 10 is free software's friend | first = Nick | last = Heath | language = en-US | date = 2017-09-20 | access-date = 2022-02-18 | publisher = TechRepublic |archive-url=https://web.archive.org/web/20221201110051/https://www.techrepublic.com/article/will-microsoft-love-linux-to-death-shuttleworth-and-stallman-on-whether-windows-10-is-free-softwares/ |archive-date=2022-12-01 |url-status=dead}}

In 2021, Jim Salter writing for Ars Technica called WSL "the best part of Windows 11," noting the ability to run applications with graphics and sound and install multiple distributions side-by-side.{{Cite web |last=Salter |first=Jim |date=2021-10-07 |title=The best part of Windows 11 is a revamped Windows Subsystem for Linux |url=https://arstechnica.com/gadgets/2021/10/the-best-part-of-windows-11-is-a-revamped-windows-subsystem-for-linux/ |access-date=2025-03-30 |website=Ars Technica |language=en-US}}

WSL has most widely been described as a tool used and useful for developers,{{Cite web |date=2018-02-12 |title=How Does the Windows 10 Subsystem for Linux Work and What Is It For? - Petri IT Knowledgebase |url=https://petri.com/bash-out-of-beta-in-windows-10/ |access-date=2025-03-30 |language=en-US}} and not generally as being recommended for end users.{{Cite web |last=Salter |first=Jim |date=2020-03-19 |title=Windows Subsystem for Linux is making inroads with developers |url=https://arstechnica.com/information-technology/2020/03/the-windows-subsystem-for-linux-conference-was-a-virtual-success/ |access-date=2025-03-30 |website=Ars Technica |language=en-US}}{{Cite web |last=Walker |first=Brian |date=2023-04-27 |title=No, You Don't Need Microsoft Windows Subsystem for Linux (WSL), and Here's Why |url=https://www.makeuseof.com/dont-need-microsoft-windows-subsystem-for-linux/ |access-date=2025-03-30 |website=MUO |language=en}}{{Cite web |last=Bhartiya |first=Swapnil |date=2018-02-12 |title=Windows Subsystem for Linux: A Bridge Between Two Platforms |url=https://www.linux.com/training-tutorials/windows-subsystem-linux-bridge-between-two-platforms/ |access-date=2025-03-30 |website=Linux.com |language=en-US}} Reviewers criticized some limitations, noting that it is not the same as having Linux and that it suffers from some performance limitations, including slow disk I/O.

See also

{{Portal|Linux}}

References

{{Reflist}}

Further reading

  • {{cite book|author-first=Hayden|author-last=Barnes|year=2021|title=Pro Windows Subsystem for Linux (WSL): Powerful Tools and Practices for Cross-Platform Development and Collaboration|publisher=Apress|isbn=978-1484268728}}
  • {{cite book|author-first=Stuart|author-last=Leeks|year=2020|title=Windows Subsystem for Linux 2 (WSL 2) Tips, Tricks, and Techniques: Maximise productivity of your Windows 10 development machine with custom workflows and configurations|publisher=Packt Publishing|isbn=978-1800562448}}
  • {{cite book|author-first=Prateek|author-last=Singh|year=2020|title=Learn Windows Subsystem for Linux: A Practical Guide for Developers and IT Professionals|publisher=Apress|isbn=978-1484260371}}