[an error occurred while processing the directive]
RSS
Логотип
Баннер в шапке 1
Баннер в шапке 2

Windows Subsystem for Linux

Product
Developers: Microsoft
Last Release Date: 2022/09/24
Technology: OS

Content

Windows Subsystem for Linux (WSL) is a function that allows running Linux applications on the Windows 10 operating system without virtualization and emulation. The technology provides interfaces that are largely compatible with Linux kernel interfaces, which translates Linux system calls to Windows system calls. The WSL subsystem was fully developed by Microsoft and does not contain any Linux kernel source code. WSL creates a complete Linux development environment for programmers, allowing them to test programs on Windows computers

2022

Systemd Support

On September 24, 2022, it became known that Microsoft and Canonical added systemd support to the Windows subsystem for Linux, which will allow more compatible applications to be installed.

As reported, systemd is a service initialization and control subsystem in Linux, which actually supplanted the traditional init subsystem in the 2010s. The main feature is intensive parallelization of service startup during system boot, which allows you to optimize the launch of the operating system. The main control unit is a module, one of the types of modules is "services" - an analogue of daemons - sets of processes launched and controlled by the means of the subsystem and isolated by control groups.

Since systemd is responsible for starting all other services, it starts as the first process (PID 1) created by the Linux kernel at startup. All other initial startup services are then started and managed by systemd, as shown in the process tree below from Ubuntu.

Process tree. Illustration: securitylab.ru.

Since WSL uses init as a system and service manager as of September 2022, Linux applications requiring systemd, such as Snap, microk8s (Kubernetes) and systemctl, do not work correctly.

Microsoft and Canonical announced that the latest pre-release version of the Windows for Linux subsystem in Windows 11 Insider builds now supports systemd, allowing applications that require a service manager to be installed.

File:Aquote1.png
Systemd support required changes to the WSL architecture. Since systemd requires PID 1, the WSL initialization process running on the Linux distribution becomes a child of systemd.

explained by Craig Lowen of Microsoft
File:Aquote2.png

Since the WSL initialization process is responsible for providing infrastructure for communication between Linux and Windows components, changing this hierarchy required a rethink of some assumptions made during the WSL initialization process.

Users who use the Windows 11 Insider build can upgrade to pre-release WSL 0.67.6 or later using the wsl --update command. You can check the installed version using the wsl -version command, as shown below.

wsl -version command. Illustration: securitylab.ru.

Now you can enable systemd by running the desired WSL Linux distribution and adding the following lines to/etc/wsl.conf:

[boot] systemd =[1].

Integration with Windows Server 2022

The company Microsoft announced integration support for - Linux configuration based on the WSL2 subsystem (Windows Subsystem for Linux) in the released June consolidated update of Windows Server 2022. Initially, the WSL2 subsystem, which provides the launch of executable files Linux on Windows, was offered only in Windows versions for workstations. This became known on June 22, 2022. More. here

2020: WSL2 - support for Linux applications with a graphical interface

On May 19, 2020, Microsoft announced the addition of support for running Linux applications with a graphical interface to Windows 10. As an example at Build 2020, the company demonstrated the launch of applications such as the Eye of GNOME file manager, gedit text editor and mpv media player on the Windows desktop.

The Microsoft blog posted a screenshot in which the Eye of GNOME application is open in a separate window next to the Windows application window. Outlook To implement this feature, the Windows Subsystem for Linux tool has been updated - version WSL2 has been released.

In Windows 10, you can now run Linux applications with a graphical interface

Microsoft first added launch support to Windows, operating system Ubuntu which can be accessed through the Bash command shell.

One of the most frequent requests to Microsoft is the ability to run not just command-line applications in Windows, but applications with a graphical interface, the company said.

File:Aquote1.png
In some cases, users would like to be able to run preferred text editors or integrated development environments written for Linux, or simply develop Linux applications on their Windows PC, Microsoft added.
File:Aquote2.png

As a result, the corporation decided to add support for Linux applications with a graphical interface and the ability to work simultaneously with Linux and Windows applications, as if the distribution was launched in a virtual machine.

File:Aquote1.png
You will even be able to run applications optimized for the Linux environment, the company said.
File:Aquote2.png

On Windows, you can run Linux applications with a graphical interface using an X server. However, this is accompanied by performance problems.

Microsoft also announced the addition of graphics accelerator support to WSL. In addition, WSL will soon support a simplified installation process using the'wsl.exe - -install' command, which will allow you to quickly start working with Linux applications on Windows.[2]

2019

Windows 10 WSL2 allows you to configure global settings

On August 5, 2019, it became known that Microsoft released a feature for the WSL2 subsystem (Windows for Linux version 2), which allows you to configure global parameters for all installed distributions on the Windows 10 system . To do this, you will need to create a.wslconfig configuration file in the% UserProfile% user folder.

Since all WSL2 distributions run on the same virtual machine, after creating a global configuration file, it will be used for all WSL2 distributions installed in Windows 10. Linux distributions running under WSL1 will not be affected by this configuration file. To view a list of installed WSL2 distributions that will affect the global configuration file, enter the wsl-l-v command.

The parameters specified by the user will only be used after he creates a configuration file and restarts the Linux distribution.

It also became possible to specify a custom ​​Linux kernel for use with installed distributions. As part of the release of the WSL2, Microsoft also posted its ​​Linux kernel for sharing on the GitHub repository. Users can recompile this kernel to include a specific module or patch. It is enough to compile a custom kernel, save it in Windows 10, and then use the kernel = option to specify the full path to the kernel. After restarting the Linux distribution, the WSL2 will use this configured[3] kernel[4].

Built-in full Linux kernel in WSL 2

On May 7, 2019, it became known that the company Microsoft introduced an updated WSL 2 subsystem designed to run files Linux executable in. Windows A key feature of the WSL 2 update is the built-in full-fledged kernel Microsoft Linux.

According to the developer, the first test builds for participants in the Windows Insider program will be released at the end of June 2019. The custom kernel will provide the basis for the Microsoft Windows Subsystem for Linux (WSL) 2 architecture. The implementation of a full-fledged Linux kernel in WSL 2 will improve compatibility, significantly increase the performance of Linux applications under Windows, speed up boot times, optimize RAM use, speed up file system I/O and run Docker containers directly, not through a virtual machine.

According to Microsoft internal testing, the second edition of WSL works 20 times faster than WSL 1 when unpacking tarball archives and about 2-5 times faster when using git clone, npm install and cmake in various projects.

As noted in Microsoft, the first release of WSL 2 will be based on a long-term stable version of Linux 4.19. As the fixes for LTS branch 4.19 are released, the kernel for WSL 2 will be quickly updated through the Windows Update mechanism and tested in the Microsoft continuous integration infrastructure.

According to the company, the kernel will be completely open. Microsoft will also provide developers with instructions to create their own versions of the kernel. The tech giant promised to post all the information on Github.[5]

2018: Support for all Linux distributions

In March 2018, Microsoft announced the expansion of the Windows Subsystem for Linux (WSL) tool, which implements the Linux environment in a Windows environment. If earlier the Linux terminal running inside Windows 10 supported only popular distributions, now compatibility with all projects has been implemented. 

Microsoft opened the source code of some WSL components so that developers could create custom Linux distributions that could be run on Windows 10. The WSL-DistroLauncher project, written in the C++ programming language, is available in clear text on the GitHub portal. It allows you to develop packages for Linux, followed by placement in the Microsoft Store. The developers themselves cannot download the distributions to the online store themselves - only with agreements with Microsoft.

Microsoft allowed any Linux distributions to run in Windows 10
File:Aquote1.png
We know that many Linux distributions are built entirely on open source software, so we would like to bring WSL closer to the Open Source community. We hope that this open source project will help increase community participation and add more of your favorite distributions to the Microsoft Store, "WSL team member Tara Raj wrote in a Microsoft blog post. 
File:Aquote2.png

The first to connect to the Windows Subsystem for Linux project at one time, Canonical which placed its distribution in Ubuntu the Microsoft Store. Then Microsoft established cooperation with the developers of distributions,, SUSE Debian Kali and. Fedora[6]

Notes