Penguin in the Window: On the Potential and Prospects of WSL2

Hello, Habr!

As our summer sale continues in full swing, we would like to discuss one of the most significant topics we have been exploring lately — the interaction between Windows and Linux, particularly regarding the development of the system.WSL 2 is on the horizon, and we present to you a brief overview of the features awaiting us in this subsystem, as well as forecasts for further integration between Windows and Linux. Windows Subsystem for Linux);In May of this year, Microsoft announced that WSL2, the latest version of the Windows Subsystem for Linux, will run on a complete Linux kernel built by the company.

Penguin in the Window: On the Potential and Prospects of WSL2

This marks the first time Microsoft has included a Linux kernel as a component in Windows. Additionally, Microsoft is introducing a command line in Windows that will enhance the capabilities of PowerShell and WSL.
Both the Linux kernel for WSL2, developed by Microsoft, and the new Windows command line are particularly interesting to developers.

"This is the strongest move in the game against AWS," notes Joshua Schwartz, head of digitalization programs at consulting firm A.T. Kearney.

The future of Microsoft is not tied to the PC market, although it will continue to maintain a strong position in this segment. It will be far more important to secure a foothold in the cloud market, one component of which may include desktop PCs in the future.

What does WSL2 do?

WSL2 is the latest infrastructure of the Windows Subsystem for Linux. It allows for a radical increase in file system performance and provides full compatibility with system calls.

One of the main requests from the WSL community was about enhancing functionality. More tools run on WSL2 under Linux compared to WSL, including Docker and FUSE.

WSL2 handles intensive file operations, such as git clone, npm install, apt update, and apt upgrade. The actual speed increase depends on the specific application and how it interacts with the file system.
Initial tests showed that WSL2 is about 20 times faster than WSL1 at unpacking tar from zip files. In various projects involving git clone, npm install, and cmake, the system exhibited a performance increase of two to five times.

Will this help win developer trust?

Will this help win the trust of developers?

Essentially, Microsoft aims to gain recognition and trust within the developer community by developing its own version of the Linux kernel to support WSL2 processes, believes Cody Swann, CEO of Gunner Technology.

"Except for development strictly for Windows, creating all other applications – cloud, mobile, web applications – on a PC was extremely inconvenient, leading developers to have to run a Linux distribution alongside Windows. Microsoft recognized this and offered a solution," he concludes.

It is unlikely that the implementation of its own Linux kernel will significantly affect the system's operation from the ordinary user's perspective. However, it opens up opportunities for closer interaction between Microsoft services and the Linux operating system.
This move by Microsoft is quite clever as it helps them penetrate deeper into the developer community and actively utilize products developed by others – that is, connect with open source – believes Swann.

Welcome to New Microsoft

The trend towards creating and supporting a Linux kernel "specifically for Windows" reflects a clear direction towards open-source development promoted by CEO Satya Nadella. Microsoft is no longer what it was under Gates and Ballmer, when everything was kept behind a proprietary fence and interoperability was hardly considered.

"Satya has completely transformed Microsoft into a much more modern platform, and this strategy has paid off immensely. Hello, trillion-dollar market cap," says Schwartz.

According to Charles King, chief analyst at Pund-IT, Microsoft’s two main advantages relate to efficiency and security.

"By actively utilizing its own substantial resources and tools, the company can guarantee customers that the kernel will be fully up-to-date and equipped with the latest patches and fixes, ensuring complete security," he adds.

Developers are also benefiting.

Linux binary files perform many functions through system calls, such as accessing files, requesting memory, and creating processes. WSL1 relies on a translation layer that interprets many of these system calls, allowing them to interact with the Windows NT kernel.

The most challenging aspect is implementing all system calls. Since this was not accomplished in WSL1, some applications could not function there. In WSL2, many new applications can run smoothly in this environment.

The new architecture allows Microsoft to introduce the latest optimizations to the Linux kernel much faster than with WSL1. Microsoft can update the WSL2 kernel instead of having to reimplement all the limitations.

Completely open-source tool

The development of a custom Linux kernel by Microsoft culminated years of work carried out by the Linux Systems Group as well as many other teams across the Microsoft corporation, according to Jack Hammons, Program Manager at the Linux Systems Group, Microsoft.

The kernel provided for WSL2 will be fully open-source, and Microsoft will post instructions on GitHub on how to build such a kernel. The company will engage with developers who want to contribute to the project and encourage upstream changes.

Microsoft developers created WSL2 using the continuous integration and continuous delivery systems at the company. This software will be serviced through the Windows update system and will be completely transparent to the user. The kernel will remain current and include all features of the latest stable branch of Linux.

To ensure the availability of source code, the company mirrors repositories locally and constantly monitors the Linux mailing list for security issues while collaborating with several companies that support database operations in corporate virtual environments (CVE). This guarantees that the Linux kernel from Microsoft will incorporate the latest updates and address any emerging threats.

Upstream changes become mandatory

Microsoft guarantees that all kernel changes will be propagated in an upward direction—this is an important aspect of the Linux philosophy. Supporting downward patches involves additional complexity; moreover, this practice is not commonly accepted in the open-source development community.

Microsoft's goal, as an active user of Linux, is to become a disciplined member of this community and to make the changes available to it. To achieve stability in long-term support branches, some patches—such as those containing new features—may be included only in new kernel versions, rather than being ported to the current LTS version for backward compatibility.

When the WSL kernel sources become available, they will consist of links to a set of patches and a long-lasting stable part of the sources. Microsoft expects this list to shrink over time, as patches are propagated upward, and new local patches are added to support the latest features of WSL.

A more pleasant window design

Microsoft also announced the upcoming release of the 'Winter' version of Windows Terminal—this new application is for users working with command line tools and shells, particularly Command Prompt, PowerShell, and WSL.

Penguin in the Window: On the Potential and Prospects of WSL2

Windows Terminal

Windows Terminal 1.0 offers many settings and configuration options that provide greater control over the appearance of the terminal window, as well as over the shells/profiles that should open as new tabs.

Settings will be saved in a structured text file, making it easy to configure and personalize the terminal window to one's liking.

Microsoft is discontinuing the development of the existing Windows Console and is creating a new application from scratch, opting for a fresh approach. Windows Terminal installs and runs alongside the existing Windows Console application that comes 'out of the box'.

How it works

When a Windows 10 user directly launches Cmd/PowerShell/etc., a process tied to a standard instance of the Console is triggered. The new terminal configuration mechanism allows Windows users to create multiple profiles for all desired shells/applications/tools, whether in PowerShell, Command Prompt, Ubuntu, or even for SSH connections to Azure or IoT devices.

These profiles can include custom font styles and sizes, color themes, blurriness levels, or background transparency. Additionally, users will be able to select a new monospaced font to make the terminal window look more modern and stylish. This font will feature programming ligatures and will be released as open source, stored in its own repository.

The main advantages of the new Windows command interface are the multiple tabs and beautiful text. Multi-tab support was the most requested feature for terminal development. Beautiful text is rendered thanks to the DirectWrite/DirectX rendering engine, equipped with GPU acceleration.

The engine displays text icons, glyphs, and special characters available in fonts, including Chinese, Japanese, and Korean ideograms (CJK), emojis, powerline symbols, icons, and programming ligatures. Furthermore, this engine renders text much faster than GDI, which was previously used in the console.

Backward compatibility remains fully intact, although if desired, one can try Windows Terminal.

Timeline: How this will unfold

Microsoft will provide Windows Terminal through the Microsoft Store on Windows 10 and will regularly update it. This way, users will always be working with the latest versions and the most recent enhancements – practically effortlessly.

Microsoft plans to launch the new terminal by next winter. After Microsoft releases Windows Terminal 1.0, developers will continue to work on many features already postponed in the backlog.

The source code for Windows Terminal and Windows Console has already been released on GitHub.

What can we expect in the future?

The possibility that Microsoft will use its own Linux kernel for other purposes, such as developing its own Linux distribution, seems somewhat hypothetical today.

The outcome likely depends on whether Microsoft can identify significant demand for such a product and what commercial opportunities such developments may open, says Charles King.

He believes that in the foreseeable future, the company will focus primarily on ensuring increasingly tighter compatibility between Windows and Linux and their mutual enhancement.

Joshua Schwartz believes that in this case, it will be necessary to weigh the investments required for this work against the returns it will provide. If Microsoft were a completely young company today, it would probably build everything on Linux. However, porting all the existing developments of Microsoft to the native architecture of Linux seems today to be an expensive and complex project that is hardly likely to yield good returns. Linux enthusiasts will have their Linux, while the core architecture will remain untouched.

When Apple reinvented Mac OS in 2000, that operating system was built on BSD Unix, which is more similar to Linux than to DOS. Today, the new version of Microsoft Windows is being developed based on Linux.

Perhaps a new door is opening before us?

Microsoft’s Linux kernel could pave the way for closer interaction between Windows services and the Linux operating system. Essentially, these developments by Microsoft indicate that even within the company, it is understood that almost no clients prefer to exist in a world dominated entirely by Windows.

It is far more sensible to use heterogeneous technologies and systems that best meet business requirements and specific practical situations.

A more important strategic question is what new strategic opportunities such a move opens for the Microsoft platform itself?

Azure, Microsoft's cloud ecosystem, already provides tremendous support for Linux. Previously, Windows supported Linux well through virtual machines.

The fundamental changes occurring today relate to the fact that Linux processes will now run natively on the Windows kernel, meaning that working with Linux from Windows will be much faster than on virtual machines. It is quite possible that as a result, Azure will be enriched with a whole layer of engineers using Linux on an industrial scale.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster