Announcing WSL 2

Craig Loewen

Craig

Today we’re unveiling the newest architecture for the Windows Subsystem for Linux: WSL 2! Changes in this new architecture will allow for: dramatic file system performance increases, and full system call compatibility, meaning you can run more Linux apps in WSL 2 such as Docker.

What exactly is WSL 2?

Our top requests from the WSL community have been to increase the file system performance, and make more apps work inside of WSL (i.e: introduce better system call compatibility). We have heard your feedback, and are glad to announce that WSL 2 helps solve these issues.

WSL 2 is a new version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1 (the current widely available version). Individual Linux distros can be run either as a WSL 1 distro, or as a WSL 2 distro, can be upgraded or downgraded at any time, and you can run WSL 1 and WSL 2 distros side by side. WSL 2 uses an entirely new architecture that uses a real Linux kernel.

Microsoft will be shipping a Linux kernel with Windows

Yes, you did just read that heading correctly! We will be shipping a real Linux kernel with Windows that will make full system call compatibility possible. This isn’t the first time Microsoft has shipped a Linux kernel, as we have already shipped one in 2018 when we announced Azure Sphere. However, this will be the first time a Linux kernel is shipped with Windows, which is a true testament to how much Microsoft loves Linux! We’ll be building the kernel in house from the latest stable branch, based on the source available at kernel.org. In initial builds we will ship version 4.19 of the kernel.

This kernel has been specially tuned for WSL 2. It has been optimized for size and performance to give an amazing Linux experience on Windows. We will service this Linux kernel through Windows updates, which means you will get the latest security fixes and kernel improvements without needing to manage it yourself.

Lastly, of course this Linux kernel will be fully open source! When we release WSL 2 we will have the full configuration available online on Github, so you can see how it works and build it yourself. If you’d like to read more about this kernel you can check out this blog post written by the team that built it.

A quick explanation of the architectural changes in WSL 2

WSL 2 uses the latest and greatest in virtualization technology to run its Linux kernel inside of a lightweight utility virtual machine (VM). However, WSL 2 will NOT be a traditional VM experience. When you think of a VM, you probably think of something that is slow to boot up, exists in a very isolated environment, consumes lots of computer resources and requires your time to manage it. WSL 2 does not have these attributes. It will still give the remarkable benefits of WSL 1: High levels of integration between Windows and Linux, extremely fast boot times, small resource footprint, and best of all will require no VM configuration or management.

Here’s a quick demo of WSL 2 in action. When we start our distro we get access to a working bash shell in under two seconds, and can run services and apps like docker right away. To summarize: while WSL 2 does use a VM, it will be managed and run behind the scenes leaving you with the same user experience as WSL 1.

You can expect more detail on the exact changes to the architecture posted to this blog in the near future, so please stay tuned!

How much faster is WSL 2?

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 forwards to seeing speed comparisons from the community when we release!

Full System Call Compatibility

Linux binaries use system calls to perform many functions such as accessing files, requesting memory, creating processes, and more. In WSL 1 we created a translation layer that interprets many of these system calls and allows them to work on the Windows NT kernel. However, it’s challenging to implement all of these system calls, resulting in some apps being unable to run in WSL 1. Now that WSL 2 includes its own Linux kernel it has full system call compatibility. This introduces a whole new set of apps that you can run inside of WSL. Some exciting examples are the Linux version of Docker, as well as FUSE!

Using WSL 2 means you can also get the most recent improvements to the Linux kernel much faster than in WSL 1, as we can simply update the WSL 2 kernel rather than needing to reimplement the changes ourselves.

WSL 2 will be a much more powerful platform for you to run your Linux apps on, and will empower you to do more with a Linux environment on Windows.

Release details

Initial builds of WSL 2 will be available through the Windows insider program by the end of June 2019.

We will be announcing when the initial release is available right here on this blog, as well as on Twitter. You can follow the WSL team on Twitter below, where you can ask us questions and get more updates on everything WSL.

WSL Team members on Twitter:

  • Taylor Brown @Taylorb_msft
  • Yosef Durr @yosefdurr
  • Sven Groot @svengroot_ms
  • Ben Hillis @benhillis
  • Craig Loewen @craigaloewen
  • Sunil Muthuswamy @SunilMut
  • Brian Perkins
  • Palkesh Soni @sonipalkesh
  • John Starks @gigastarks
  • Craig Wilhite @CraigWilhite
  • Kayla Cinnamon @cinnamon_msft

Thank you so much for your support. We can confidently say that WSL would not be what it is today without its amazing community, and as always, we look forwards to hearing your valued feedback about the new WSL!

-The WSL Team

Craig Loewen
Craig Loewen

Program Manager, Windows Developer Platform

Follow Craig   

81 Comments
Avatar
Carlos Guizar 2019-05-06 13:06:22
So if I understand correctly this will be available until end of  June right , because currently I get this output: cguizar@N-20L6PF1JBK83:~$ sudo /etc/init.d/docker start[sudo] password for cguizar:* Starting Docker: docker [ OK ]cguizar@N-20L6PF1JBK83:~$ sudo docker run -it alpine ashdocker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.See 'docker run --help'.cguizar@N-20L6PF1JBK83:~$ sudo /etc/init.d/docker status* Docker is not runningcguizar@N-20L6PF1JBK83:~$ sudo iptables -Liptables v1.6.1: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)Perhaps iptables or your kernel needs to be upgraded.
Avatar
Aaron Kelley 2019-05-06 13:25:10
Since it is a "lightweight" VM, are there any additional dependencies?  (i.e. Hyper-V)
Avatar
Simon Timms 2019-05-06 13:47:14
This is an amazing engineering effort, I'm seriously impressed by the WSL in its current form let alone in the v2. I'm busy imagining all sorts of fun applications for this.
Avatar
Richard M Stallman 2019-05-06 14:48:40
I'd just like to interject for a moment. What you're referring to as Windows, is in fact, GNU/kWindows, or as I've recently taken to calling it, GNU plus the Windows kernel. Windows is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called "Windows", and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is Windows, and these people are using it, but it is just a part of the system they use. Windows is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Windows is normally used in combination with the GNU operating system: the whole system is basically GNU with the Windows kernel added, or GNU/kWindows. All the so-called "Windows" distributions are really distributions of GNU/kWindows.
Avatar
Gabriel 2019-05-06 15:03:54
Avatar
Niklas Mollenhauer 2019-05-06 16:08:55
Will we be able to mount ext drives? Will this require Hyper-V?
Avatar
Benjamin Felbrich 2019-05-06 17:52:11
Does full system call combatability mean driver support? And thus potentially GPU support? Keep up the good work. WSL is an awsome feature!
Avatar
‪ ‪ 2019-05-06 18:03:49
WSL2 does supports Windows 10 Home edition?
Avatar
Craig Anderson 2019-05-06 18:25:42
Thanks for all your good work. As a daily user of WSL, I'm really looking forward to trying out WSL2.
Avatar
Zhang Chen 2019-05-06 19:13:45
So, I guess WSL2 actually is LCOW?
Avatar
朴宇 韩 2019-05-06 21:57:09
Does WSL2 work like ChromeOS's Crosini?Can we use Windows/WSL Interop and usb/serial port in WSL2?
Avatar
Masami M 2019-05-06 23:15:51
I'll continue to use bare Linux and Windows in VM if needed for my work, anyway. :)
Avatar
rafiul islam 2019-05-06 23:20:21
does "System has not been booted with systemd as init system (PID 1). Can't operate." fixed?
Avatar
Aaron Franke 2019-05-07 00:24:46
This is awesome, but when will we get the ability to mount EXT4 partitions?
Avatar
Moritz Beutel 2019-05-07 01:48:25
I only wish Hyper-V didn't require SLAT. It used to work fine without SLAT on Windows Server 2012 (though not on Windows 8.x), and so do most competitor's virtualization products. If WSL2 depends on Hyper-V, and if the SLAT requirement stays, WSL2 won't run on many older machines (e.g. Core 2), which is a pity.
Avatar
haining cao 2019-05-07 02:11:55
Does using a VM mean that PCI passthrough is possible?
Avatar
Sven Knurr 2019-05-07 02:15:53
Could we have a transparent path translation please? I like the WSL for what it attempts to do (although I mainly use it to run Plan 9 software on Windows), but having to open files from /mnt/c/... still feels wrong to me.
Avatar
Chen Xu 2019-05-07 04:32:42
Hi, Craig, Is there any dogfood version? I'd like to test WSL2 as early as possible :D
Avatar
Luiz Felipe F M Costa 2019-05-07 05:28:24
Finally!! For the first time I'll be able to work using Windows! File explorer (from latest Insiders build) and Docker support for WSL 2!!! \õ/ Thanks a lot got this awesome job!!
Avatar
jolt foo 2019-05-07 05:33:50
what if my 'host' windows is already running as a vm?
Avatar
Ömer Fadıl USTA 2019-05-07 10:06:56
are you talking linux kernel reimplementation or original linux kernel ? if it is real linux kernel you couldn't bundle a gplv2 licenced product with a non gpl compatible licence otherwise you have to opensource whole windows's source code and relicense your product with compatible license.
Avatar
Thomas A 2019-05-07 16:57:06
Will loading custom kernel modules be supported? This would be very useful for projects like Darling.
Avatar
Tiago Matias 2019-05-08 02:18:50
I'm reallly looking forward for this. It would be a major factor in allowing windows (re)gain a place in the modern development paradigm. With the shift towards toolchain oriented development processes (long gone are the days of just pressing F5 on the IDE) there just isn't a way to run all the stuff we tipically need (yarn, docker, npm, node, python, ruby) as these things require a proper posix shell to be glued together. Tons of developers have to shift to MacOS or Linux desktops because they provide such a shell with all the GNU tools we know and love. I hope what with WSL2 this changes quickly.
Avatar
Masoom Shaikh 2019-05-08 04:47:51
"Linux kernel inside of a lightweight utility virtual machine (VM)" Since this is VM, would all CPU cores be available to it? A common use case is cross compiling. It is highly desirable to fire up all cores for such CPU intensive puposes. What about networking? Will it be NAT'ed? or it can see physical interfaces they way WSL 1 does? basically will output of "ipconfig" in cmd.exe and "ip a s" in WSL2 bash match?
Avatar
Koray Toksoz 2019-05-08 05:11:49
Please don't tell us it requires "hyper-v". 
Avatar
Chen, Miles 2019-05-08 05:37:54
Does WSL2 work against virtualized Windows hosted on Azure or AWS since it requires VT-in-VT?
Avatar
Kenneth Benson 2019-05-08 08:11:19
I need to know just this: 1)Will it allow FULL access to USB, as in any device can be used (ie. usb connected IoT devices)? 2)Will CUDA and OpenCL work on WSL 2 for GPU computations? If these will not work then I must regretfully decline it's install and use, and will maintain a separately bootable Linux partition to do my development in.
Avatar
J. Pablo Fernández 2019-05-08 08:32:48
Would this finally make Ruby somewhat useable on Windows?
Avatar
J. Pablo Fernández 2019-05-08 08:34:44
Is there a way to test an alpha or beta of this to see if it had any effect on Ruby's performance?
Avatar
Pey Lian Lim 2019-05-08 08:56:04
Hi. This is great news! How do I join this "insider" (early beta testing) program? I do not use Twitter.
Ish Raqiyun
Ish Raqiyun 2019-05-08 09:59:46
Been using WSL since mid-to-late 2017 without really any issues to speak of. Then I started to learn Docker and Kubernetes, and implement them in to my projects. Basically forced me to start using Ubuntu due to Hyper-V conflicts with my other VMs some of which can't run on Hyper-V, and Hyper-V doesn't play with VBox and VMware nicely). Sure, you can try Docker Toollboox which uses VBox, but it is incredibly buggy and slow. Thus, switching to Ubuntu solved the issues at the loss of Office and having to run even more VMs (Edge and IE). So this is great news to me and hopefully means I can switch back to Windows and run fewer VMs for my needs. So what I'm wondering: 1. I read somewhere WSL2 and Docker containers in it won't use Hyper-V so we can run other VMs in VMware or VBox without issue. Is this confirmed? 2. Does this also mean it will work Kubernetes, kubectl, and minikube?
Avatar
Hudarsono Ok 2019-05-09 04:21:19
Btw, since this WSL 2 still running under VM, what would be the difference if we just install "console only" linux via VM or Hyper V? 
Avatar
David Refoua 2019-05-09 13:21:37
I couldn't dream of a day we could have such an amazing technology built into the Windows, by Microsoft itself! I'd like to say that I appreciate all the effort you guys put into developing WSL/2, and would like to see it becoming an standard environment for development on Windows :)
Avatar
Saul Fautley 2019-05-10 06:26:10
Oh man. This is finally going to propel Windows to one of the best OS choices for developers, if not THE best. The power of Linux and the UX of Windows. I think I just had my first nerdgasm... 🤓
Avatar
Adrien JOLIBERT 2019-05-10 07:38:30
Cannot wait to play with System Call Compatibility on Insider Preview (currently 190503-1728).
Avatar
Warren Leyes 2019-05-10 21:58:01
I would love to see comparison between WSL2 (which as mentioned is a managed vm behind the scenes) vs. Virtualbox VMware etc. to see if it is indeed worth it. I am often running 2-4 Linux virtual machines on Windows. Anybody have any insight?
Avatar
sun xing 2019-05-11 00:14:42
Does it support cuda? It's important for deep-learning developers.
Avatar
Purnama Yasa 2019-05-12 03:52:30
Can we now exec 32bit ELF ?
Avatar
Wu, Baosong 2019-05-16 19:28:51
I have a quick question: waht is the long term plan for WSL - it is going to be a toy or one day MS expect it can run production services?
Avatar
Alistair Hardy 2019-05-17 03:55:59
And a release \ devops guy, being able to run Docker properly is huuuuuuuge. Hopefully Docker for Windows will move over to support it nicely. Especially as VS Code announced it's going to utilise WSL 2 for remote working over SSH. 
Avatar
noah curoe 2019-05-18 19:53:58
Yikes, Hyper-V being required is a major problem for half of the people who need WSL. Until VMWare/Virtualbox play nice with Hyper-V, WSL 2 will be out of the question.
Avatar
Malte Spannmacher 2019-05-22 05:09:37
I wonder if any gui applications can be RUN with WSL 2? Or will we still need to run a seperate X Server under Windows such as Xming?
Avatar
Nigel Jones 2019-05-24 03:06:44
I use a lowly surface pro (2018) 4GB i5. I use WSL occasionally, and know I can continue to do so. Given WSL2 requires Hyper-V, is it a bad idea to enable on a low resource mobile device? Will it impact power saving, ram consumption? And will WSL2 add more or less overhead? Or is the combo a good one? No qualms on a higher end desktop.
Avatar
Yaniv Bargury 2019-06-13 13:53:12
Sounds like a sneaky way to get me to dump VMware and move to the Microsoft copy cat. Not going to happen. I use WSL as my primary development environment these days because it's not on a VM. Do you really think that someone that uses WSL is not capable enough to install Linux on a VM themselves. What were you thinking? If WSL not on VM stops being an option I'll have to  say goodbye to my windows desktop and move to Linux as a host, else I can't do my job.
Avatar
Stephen Morgan 2019-06-17 16:50:40
I have an application that runs under Linux and performs asynchronous I/O using Linux libaio (esp. the io_submit() call) directly on storage devices such as /dev/sdb, /dev/sdc, and so forth. I would like to run this application under Windows 10 without having to explicitly port it. I wonder whether the new "Windows Subsystem for Linux 2" facility would enable me to run this application? If so, I wonder whether the WSL2 facility would efficiently implement asynchronous I/O itself when interacting with Windows 10? (The application has to be extremely efficient in terms of issuing and scheduling I/Os.) Any help would be appreciated. Thanks!
Avatar
Stephen Morgan 2019-06-18 11:49:37
Is there any chance that I can use WSL2 on Windows 10 that is itself running in a VM? If so, are there any tricks to know? Thanks!
Avatar
ping zhang 2019-06-22 16:26:27
PS C:\Users\dqzha\ubuntu> wsl --set-version ubuntu-18.04 2Conversion in progress, this may take a few minutes...For information on key differences with WSL 2 please visit https://aka.ms/wsl2Conversion complete.PS C:\Users\dqzha\ubuntu> wsl -l -vNAME STATE VERSION* Ubuntu-18.04 Stopped 2PS C:\Users\dqzha\ubuntu> wslThe attempted operation is not supported for the type of object referenced.PS C:\Users\dqzha\ubuntu>
Avatar
ping zhang 2019-06-22 16:31:15
after switch wsl2, can't start ubuntu: The attempted operation is not supported for the type of object referenced. PS C:\Users\dqzha\ubuntu> wsl --set-version ubuntu-18.04 2Conversion in progress, this may take a few minutes...For information on key differences with WSL 2 please visit https://aka.ms/wsl2Conversion complete.PS C:\Users\dqzha\ubuntu> wsl -l -vNAME STATE VERSION* Ubuntu-18.04 Stopped 2PS C:\Users\dqzha\ubuntu> wslThe attempted operation is not supported for the type of object referenced.PS C:\Users\dqzha\ubuntu>
Avatar
Stephen Simpson 2019-07-05 19:05:35
WSL has been a nice piece of work from MS.  But going back to a full kernel abstraction sounds retrograde step.  Isn't the NT kernel designed for this kind of thing?  How did Interix get the job done back in the day?
Avatar
Ayush Goel 2019-07-09 00:22:44
As wsl2 makes use of hyper-v which is a windows 10 pro exclusive feature, does it mean that someone having the home version cannot get wsl2? Or would it not work to its full potential?
Avatar
Janne Enberg 2019-07-12 03:04:57
It's sad to see Microsoft first taking several steps to the right direction and then taking a massive leap backwards by forcing Hyper-V for the people who want to use WSL to improve their ability to do their work. I know from experience that Hyper-V has compatibility issues with other hypervisors that people actually need and want on their machines (e.g. VirtualBox VMs are often needed for full platform-agnostic compatibility with other team members), and even if they ever get fixed, considering how it's implemented I can't even begin to imagine the performance penalties and other issues it is going to cause if I try to e.g. run games on the same computer.
Avatar
Thomas Thompson 2019-07-18 08:08:39
WSL is still useless at this point. No netfilter modules so iptables can run, bind9 installs and runs, haven't tried apache2. And as far as running a docker from wsl, why not just run it natively!? To me that's putting the cart before the horse. Get the essintials first then work on app compat.
Avatar
Wade Dorrell 2019-07-18 08:22:46
As of June 2019 WSL 2's available in Insider builds as promised: https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/ (just connecting dots here.)