Microsoft released todayWindows 10 build 18917 InsiderVersion, the most interesting of which isWSL 2 Refactored by Linux in Kernel(Windows Subsystem for Linux) is now available.
WSL 2It was announced by Microsoft on Build 2019 last month. Compared with the first generation, the new WSL has redesigned its architecture to run ELF64 Linux binaries on Windows using a real Linux kernel.
Linux binaries use system calls to perform many functions, such as accessing files, requesting memory and creating processes. WSL 1 creates a transformation layer that translates these system calls to allow them to work on the Windows NT kernel. However, implementing all these system calls is challenging, resulting in some applications not running in WSL 1.
Now WSL 2 contains its own Linux kernel, which has complete system call compatibility, which introduces a new set of applications that can run in WSL, such as the Linux version of Docker.
Microsoft introduced the usage of WSL 2 in its blog, pointing out the biggest difference between WSL 1 and 22:
Placing Linux files in the Linux root file system
Over the past three years, WSL 1 files have been required to be placed on C disk. The new architecture of WSL 2 has eliminated this problem. Now, files that are frequently accessed in Linux applications can be placed in the Linux root file system to enjoy the advantages of file performance, which will bring faster file system access.
At the same time, Windows applications can now directly access Linux root file systems, such as file resource managers. You can run `explorer.exe/` in the bash shell to test the effect.
Accessing Linux Network Applications Using Dynamic IP Address in Initial Construction
WSL 2 includes tremendous architectural changes using virtualization technology, and network support is still improving.
WSL 2 is now running in a virtual machine, so you need to use the IP address of the VM to access Linux network applications from Windows; similarly, you need the IP address of the Windows host to access Windows network applications from Linux. Microsoft's goal is to enable WSL 2 to access network applications using localhost as much as possible.
New WSL commands
The new WSL also adds commands to help users control and view WSL versions and related information.
At present, if any problems are found in Insider version testing, they can be submitted to Microsoft at https://github.com/microsoft/WSL.