Comparing WSL Versions | Microsoft Learn

Learn more about the different versions of WSL, including why WSL 2 is now the default and specific scenarios or exceptions that may justify switching from the installed Linux distribution to the previous WSL 1 architecture.

Comparing

WSL 1 and WSL 2 This guide will compare WSL 1 and WSL 2

, including exceptions to using WSL 1 instead of WSL 2. The main differences between WSL 1 and WSL 2 are the use of a real Linux kernel within a managed virtual machine, support for full system call support, and performance on Linux and Windows operating systems. WSL 2 is the current default version when installing a Linux distribution and uses the latest and greatest in virtualization technology to run a Linux kernel inside a lightweight utility virtual machine (VM). If your distribution is currently running WSL 1 and you want to upgrade to WSL 2, see Upgrading from WSL 1 to WSL 2.

Feature comparison

WSL 1 feature WSL 2 Integration between Windows and Linux Fast boot times ✅ ✅ Small resource footprint compared to traditional virtual machines Runs with ✅ ✅ current versions of VMware and VirtualBox ✅ ✅ Managed ❌ ✅ VM Full Linux kernel Full system call support ✅ ❌ ✅ ❌ Performance on all system ✅ ✅ file systems ✅ ❌

As you can see from the comparison table above, the WSL 2 architecture outperforms WSL 1 in several ways, with the exception of performance on all operating system file systems, which can be fixed by storing the project files on the same operating system as the tools you are running to work on the project.

WSL 2 is only available on Windows 11 or Windows 10, version 1903, build 18362 or later. Check your version of Windows by selecting the Windows logo key + R, type winver, select OK. (Or enter the view command at the Windows command prompt.) You may need to upgrade to the latest version of Windows. For builds lower than 14393, WSL is not supported at all.

What’s New in

WSL 2

WSL 2 is a major revision of the underlying architecture and uses virtualization technology and a Linux kernel to enable new features. The primary goals of this update are to increase file system performance and to add full system call support.

WSL 2 System Requirements Set Linux distribution version from WSL 1 to WSL 2 WSL 2 FAQ

  • WSL 2
  • architecture

  • A

traditional virtual machine experience can be slow to boot, isolated, resource-intensive, and time-consuming to manage.

WSL 2 does not have these attributes.

WSL 2 provides the benefits of WSL 1, including seamless integration between Windows and Linux, fast boot times, a small resource footprint, and no VM configuration or management required. Although WSL 2 uses a virtual machine, it is managed and runs in the background, allowing you to enjoy the same user experience as WSL 1.

The Linux

kernel in WSL 2 is built by Microsoft from the latest stable branch, based on the source available in kernel.org. This kernel has been specially tuned for WSL 2, optimizing size and performance to provide an amazing Linux experience on Windows. The kernel will be taken care of by Windows updates, which means you’ll get the latest security fixes and kernel improvements without needing to manage it yourself.

The WSL 2 Linux kernel is open source. For more information, see the blog post Submitting a Windows Linux kernel written by the team that built it.

Learn more in the Windows Subsystem Release Notes for the Linux kernel.

Increased file I/O performance

File-intensive operations such as git clone, npm install, apt update, apt upgrade, and more are noticeably faster with WSL 2

.

The actual speed increase will depend on which application you are running and how you are interacting with the file system. Initial versions of WSL 2 run up to 20 times faster compared to WSL 1 when unpacking a compressed tarball, and around 2-5 times faster when using git clone, npm install, and cmake in multiple projects.

Full

system call support

Linux binaries use system calls to perform functions such as accessing files, requesting memory, creating processes, and more. While WSL 1 used a translation layer built by the WSL team, WSL 2 includes its own Linux kernel with full system call support. Benefits include:

  • A whole new set of applications you can run within WSL, such as Docker and more

  • .

  • Any Linux kernel update is immediately ready for use. (You don’t have to wait for the WSL team to deploy the updates and add the changes.)

Exceptions for using

WSL 1 instead of WSL 2

We recommend that you use WSL 2 because it offers faster performance and 100% system call support. However, there are some specific scenarios where you may prefer to use WSL 1. Consider using WSL 1 if:

Project files

  • must be stored in the Windows file system. WSL 1 provides faster access to mounted files from Windows. If you are using your Linux WSL distribution to access project files in the
    • Windows file system, and these files cannot be stored in the Linux file system, you will get faster performance on all operating system file systems by using WSL 1.
  • A project that requires cross-compilation using Windows and Linux tools on the same files. File performance on Windows and Linux operating systems is faster in WSL 1 than in WSL
    • 2, so if you are using Windows applications to access Linux files, you will currently achieve faster performance with WSL 1.
  • Your project needs access to a serial port or USB device. However, USB device support is now available for WSL 2 through the USBIPD-WIN project. See Connect USB devices for configuration steps.
  • WSL 2 does not include support for accessing serial ports. Learn more in the FAQ or the WSL GitHub repository issue on serial support.
  • It has strict memory requirements
    • WSL’s memory usage grows and decreases as you use it. When a process frees memory, this is automatically returned to Windows. However, as of now, WSL 2 still does not release in-memory cached pages to Windows until the WSL instance is shut down. If you have long-running WSL sessions or access a large number of files, this cache can take up memory in Windows. We are tracking work to improve this experience on WSL’s GitHub repository number 4166.
  • For those using VirtualBox, you may need to consider the version you are running and whether it supports WSL 2. (See issue 798 of the WSL GitHub repository for the full discussion. It seems that VirtualBox v6.1.16 works fine with WSL 2, but that other versions may experience problems).
  • If you rely on a Linux distribution to have an IP address on the same network as your host machine, you might need to configure a workaround to run WSL 2. WSL 2 runs as a hyper-v virtual machine. This is a change from the bridged network adapter used in WSL 1, which means that WSL 2 uses a network address translation (NAT) service for it’s virtual network, rather than bridged to the host’s network interface card (NIC), resulting in a unique IP address that will change upon reboot. For more information about the issue and workaround that forwards TCP ports from WSL 2 services to the host operating system, see WSL GitHub Repository Issue 4150, NIC Bridging Mode (TCP Workaround).

WSL in

Microsoft Store

WSL has removed the functionality of updating the Windows operating system image to a package that is available through the Microsoft Store. This means faster updates and services as soon as they’re available, rather than having to wait for an update to your Windows operating system.

WSL was originally included in the Windows operating system as an optional component that must be enabled to install a Linux distribution. WSL in the Store has the same user experience and is the same product, but receives updates and services as a store package, rather than as a full operating system update. Starting with Windows version 19044 or later, running the wsl.exe -install command will install the WSL servicing update from the Microsoft Store. (See the blog post announcing this update.) If you are already using WSL, you can upgrade to ensure that you are receiving the latest WSL features and services from the store by running wsl.exe -update.