WSL is the best feature added to Windows in the last decade

When Microsoft introduced the Windows Subsystem for Linux (WSL) in the Windows 10 Anniversary Update back in August 2016, it was primarily seen as a tool for developers yearning for a Linux terminal experience. Initially, its impact seemed limited, but over the years, WSL has evolved into a robust, GPU-accelerated Linux environment, seamlessly integrated into the Windows ecosystem through regular updates and the Microsoft Store. Today, it stands as one of the most significant enhancements to the Windows operating system in recent memory.

The history of WSL

It all starts in 2016

WSL made its debut as a beta version, featuring a native-kernel translation layer that allowed Windows to run unmodified Linux ELF binaries without the need for a virtual machine. However, its early performance was lackluster, and it fell short of delivering a complete Linux experience. For those seeking full compatibility, using a Linux virtual machine was still the preferred option, as many system calls were not yet implemented in the initial WSL build.

The landscape shifted dramatically with the launch of WSL2 in May 2020. This iteration replaced the translation layer with a lightweight, real Linux kernel running in a Hyper-V utility VM, offering near-native performance and comprehensive syscall coverage. This advancement enabled tools like Docker to operate efficiently within WSL, enhancing the user experience significantly compared to native Windows installations. Features such as faster Docker daemon startups and dynamic memory allocation further optimized resource usage, making WSL a compelling choice for developers.

Since then, WSL2 has undergone continuous improvements, including GPU-compute and CUDA support introduced in 2021, and the addition of WSLg in 2022, which enabled full GUI support for X11 and Wayland desktop applications. An update in September 2022 brought systemd support, allowing for better service management. As WSL has matured, it has increasingly mirrored a true Linux experience within Windows, effectively merging the strengths of both operating systems.

Performance without compromise

It’s a true best of both worlds

WSL2 approaches the performance of bare-metal Linux for most tasks while maintaining an intuitive integration with Windows. It utilizes the Windows kernel’s memory manager, scheduler, and I/O stack, allowing users to launch a Linux shell with the same ease as opening a Windows process. Benchmarks for file-intensive operations, such as npm install and pip install, consistently demonstrate performance on par with Linux running under Hyper-V. Although there are some slowdowns when crossing the Windows-Linux file-system boundary, Microsoft has been proactive in addressing these issues.

For developers, WSL offers unparalleled convenience. From its inception, WSL has allowed access to the C drive, and it has since evolved to expose Windows executables within the Linux environment and vice versa. This seamless interaction enables developers to navigate between Visual Studio Code, Docker Desktop, and native Linux build chains without the need for dual-booting or context-switching. For instance, deploying applications directly into a WSL instance from VS Code allows for testing Linux-native applications without manual file transfers.

For those engaged in data science, WSL2 enhances productivity even further. Running PyTorch with CUDA from a WSL Ubuntu prompt while editing notebooks in Windows exemplifies the portability of data-science workflows. Official drivers from Nvidia, AMD, and Intel provide direct access to DirectML and CUDA cores within the WSL VM, enabling Windows machines to train models just as effectively as dedicated Linux workstations. The performance benefits of WSL2 extend beyond development, as many workflows run more efficiently in this environment.

Even for non-developers, WSL can enrich the Windows experience. Users can create aliases to launch Windows applications with simple commands, such as:

alias sublime='"/mnt/c/Program Files/Sublime Text/subl.exe"

This flexibility allows anyone to leverage powerful Linux tools like grep for searching, and even run Linux GUI applications. Docker, too, becomes more accessible for non-developers, simplifying deployment and usage.

What other features compare to WSL?

WSL is fantastic

In the realm of significant features introduced to Windows over the past decade, few can rival the capabilities and implications of WSL. While the revamp of Microsoft Edge, DirectStorage, and Game Bar have made their mark, they cater to more niche audiences. In contrast, WSL’s integration of Linux into Windows represents a monumental shift, opening up a plethora of possibilities for users across various domains.

With tools like Windows Terminal designed to unify terminal interactions, WSL has become an integral part of modern workflows. As more applications leverage its capabilities, the advantages of WSL become increasingly evident, particularly for developers utilizing Docker Desktop and various AI tools that thrive in a Linux environment.

For those not in the development sphere, WSL presents an excellent opportunity to explore Linux and familiarize oneself with its functionalities. The accessibility of WSL has never been greater, making it an inviting entry point for anyone interested in the world of Linux.

Winsage
WSL is the best feature added to Windows in the last decade