WSL2 - Windows Subsystem for Linux

The Microsoft Build Conference announced a major update to the Windows Subsystem for Linux (WSL). No more emulating Linux but now we can start running Linux natively on Windows. Stay tuned as the update is expected in June.

  • WSL 1
    • It was a Windows wrapper emulating Linux translating Linux API’s to the Windows Kernel
    • File system drivers were about 20x slower than native
    • Couldn’t use Linux drivers
    • Linux API’s not fully implemented
  • WSL 2
    • Faster boot times
    • Full Linux kernel running in a lightweight VM
    • Docker containers will run natively
    • File system performance

Episode Transcription

Welcome back to The Byte. In this episode, we're going to talk about Windows Subsystem for Linux.Last week, the Microsoft Build Conference released some amazing news surrounding Windows Subsystem for Linux. Now, if you don't know what the Windows Subsystem for Linux is, it is ... Version one is essentially a ... it was a Windows wrapper, so it's like emulating a Linux, translating the Linux APIs instead of Windows kernel. And Microsoft made its own translation. It was really kind of ugly because it didn't incorporate everything. Not all the Linux APIs were implemented. The file system access was like 20% slower than actually native Linux distributions. But it was a start, right? I mean, as a first go at actually having Linux running on Windows.

Now what was interesting is the Microsoft Build Conference, which is all the developer news that's coming out for the Microsoft world, they announced WSL 2. So Windows Subsystem for Linux version two. Now instead of it being an emulation of Linux, it's actually a full Linux kernel running inside a lightweight VM. And this is amazing news. I mean it's almost to the point where I'm gonna sell my MacBook and go get a Surface Book. That's the kind of news it is. What does that mean for developers? First off, it's going to be faster boot times because previously it had to load the Windows kernel and then you had to load the Linux emulation APIs and all that stuff. So it took a while for the version one load. Version two is going to be a VM. It's going to be a lightweight VM. Similar how-to Docker for desktop runs. It's going to be the same type of concept. It's just going to start up, and it's going to be there. It's going to be a full Linux kernel, so it's going to have all the capabilities that we're used to in Linux and of running on Windows, which is really quite amazing.

What does that mean? It means we can run Docker containers natively on Windows as a Linux container. I mean this is an amazing announcement. I mean now we have the full capabilities of Linux on a Windows machine. And as a developer, I mean this is something I've been looking forward to for a long time. Because the user experience on Microsoft running Docker has always been not 100%, because sometimes the containers run, you have some emulation issues ... And now that we have a full Linux kernel running, there are no excuses at all that it won't work. And we can actually do things like ... The file system performance is also going to be much better now because we're running it natively so that 20% loss that we were experiencing before WSL 1 ... WSL 2 is going to be a native file system performance.

Additionally, we're going to notice a lot of different features so we can run Linux libraries, all the drivers that weren't working previously ... So all the drivers will work. The Linux API will be as advertised. We can go into the Microsoft store and pull down certain versions. So if you want, Ubuntu, if you want Red Hat or whatever version you want, you can actually bring that down and have your own flavor of Linux running. So there's a lot of possibilities here. Obviously, I haven't played with it. I'm a Mac user, but I have been developing more and more on Windows. So it's something that's very interesting to me. I'm actually really considering getting a Surface Book now because you know my MacBook, I have that lovely keyboard that sticks all the time. So my E is like, "eee" and my W's "www". So it's really annoying. I went to the MacBook store and ... I went to the Apple store and I told them, "Hey, I would like to replace it."They said, "Yeah, no problem. Just leave your laptop with us for four or five days." I'm like, "Can have a replacement?" "No, you need to purchase a replacement." So obviously I wasn't happy with that news, and I know a lot of people are switching over to Surface Books or just Windows laptops in general. And I think this will be my transition.

Now I have a full Linux kernel running. We're expecting it to be available sometime in June. So once it's available, I'm going to do a full test on it and see exactly what we can do, run containers on it, make sure it actually runs as advertised, and I'll report back to you. But Windows Subsystem for Linux version two, it's going to be running native Linux. It's going to be in a small VM and it's going to be running as advertisers ... We've seen it before.

So what does everyone think? Send me some comments. Email me. Tell me what you think about this announcement and what it means for the Windows developer community as well as existing Mac users. Because I know the new MacBook Pros, a lot of users are looking for an alternative and this might be the bridge to move over to Windows .Let me know what you think. Have a great day and we'll see you in the next episode.
© 2020 TheByte