Author Topic: Microsoft to Ship a True Linux Kernel With Windows 10 WSL  (Read 343 times)

Offline javajolt

  • Administrator
  • Hero Member
  • *****
  • Posts: 35122
  • Gender: Male
  • I Do Windows
    • windows10newsinfo.com
Microsoft to Ship a True Linux Kernel With Windows 10 WSL
« on: May 07, 2019, 02:10:32 AM »
Microsoft will begin to ship an in-house custom built Linux kernel starting with the Windows 10 Insider builds this summer. This kernel is to become the backbone for the new Windows Subsystem for Linux 2.0 or WSL2.

Unlike WSL1, which used a Linux-compatible kernel, WSL2 will use a genuine open-source kernel compiled from the stable 4.19 version release of Linux at Kernel.org.

While Microsoft will be providing the Linux kernel, they will not provide any Linux binaries to go with it. Instead, users will still need to download their favorite Linux distribution from the Microsoft Store or by creating a custom distribution package.


Linux distributions in the Microsoft Store

While the source code for the kernel will come from Kernel.org, Microsoft has stated that they will apply custom patches that reduce the memory footprint of the kernel and provide hardware compatibility.

Quote
"In addition to the LTS source from Kernel.org, a number of local patches are being applied. These patches tune the resulting binary for use in WSL2 by improving launch times, reducing the memory footprint and curating a minimal set of supported devices. The result is a small, lightweight kernel that is purpose-built for WSL2 to be a drop-in replacement for the emulation architecture featured in the design of WSL1."

Increased performance with WSL2

In the first iteration of the Windows Subsystem for Linux (WSL1), Microsoft had to translate Linux system calls so they could communicate and work with the Windows NT kernel. With the use of a true Linux kernel, it is no longer necessary to use a translation layer and apps will have full access to their normal system calls.

Removing the translation layer not only improves compatibility for Linux apps but also increase file system performance.

According to tests performed by Microsoft, the new Linux kernel has improved the performance of WSL, with unpacking archives up to 20x faster and tools such as npm, git, and cmake being 2-5x faster.

Quote
"File intensive operations like git clone, npm install, apt update, apt upgrade, and more will all be noticeably faster. The actual speed increase will depend on which app you’re running and how it is interacting with the file system. Initial tests that we’ve run have WSL 2 running up to 20x faster compared to WSL 1 when unpacking a zipped tarball, and around 2-5x faster when using git clone, npm install and cmake on various projects. We’re looking forward to seeing speed comparisons from the community when we release!"

Below you can see a short video of WSL2 and its performance in Windows 10.



To make it easier to administer WSL2, Microsoft will also include the Linux kernel in Windows Update so that security updates and improvements will automatically be delivered to Windows 10.

For those who wish to contribute to the WSL2 kernel, Microsoft will be making it open source and will host it as a project on GitHub. Microsoft will also be providing build instructions so developers can create their own customized kernels.

source