Saturday, June 15, 2019

WSL 2

WSL 2 is a new version of the architecture in WSL that changes how Linux distros interact with Windows. WSL 2 is a major overhaul of the underlying architecture and uses virtualization technology and a Linux kernel to enable its new features. WSL 2 aims at increasing file system performance and adding full system call compatibility. Each Linux distro can run as a WSL 1, or a WSL 2 distro and can be switched between at any time. Individual Linux distros can be upgraded or downgraded at any time, and you can run WSL 1 and WSL 2 distros side by side.

The Linux kernel in WSL 2 is built in-house from the latest stable branch and is specially tuned for WSL 2.It has been optimized for size and performance to give an amazing Linux experience on Windows and will be serviced through Windows updates, which means you will get the latest security fixes and kernel improvements without needing to manage it yourself.

File intensive operations will be noticeably faster. Initial versions of WSL 2 run 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.

Some FAQs on WSL 2 : 
Will it be available on Windows 10 Home?
WSL 2 will be available on all SKUs where WSL is currently available, including Windows 10 Home.

Does WSL 2 use Hyper-V?
The newest version of WSL uses Hyper-V architecture to enable its virtualization. This architecture will be available in the 'Virtual Machine Platform' optional component. 

What will happen to WSL 1?
Currently there are no plans to deprecate WSL 1. You can run WSL 1 and WSL 2 distros side by side, and can upgrade and downgrade any distro at any time. 

Can I run WSL 2 in a virtual machine?
Yes! You need to make sure that the virtual machine has nested virtualization enabled. This can be enabled in your parent Hyper-V host by running the following command in a PowerShell window with Administrator privileges:
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
Make sure to replace '<VMName>' with the name of your virtual machine.

Check the source for more details and many more FAQs.
In our next post we will see how to install WSL 2.

(Source: Microsoft Docs)

No comments: