Saying “Windows” and “Linux” together? Yes, exactly. Furthermore, I included a word subsystem. What a combination, yes? Are we witnessing something that could perhaps assist us in bridging the gap between the two distinct worlds?
Let’s travel back in time for a little while. Developers who were more inclined towards the open-source community used Linux as their development environment, whereas those who were using the Microsoft tech stack utilised Windows. Essentially, you had two choices:
The two were very different from one another until the Windows Subsystem for Linux (WSL) was introduced. On the other hand, if cross-OS functionality truly piqued your attention and you wanted to maximise both,
- Set up your computer so that it can support dual-boot or
- To execute the second operating system from the original one, use a virtual machine of some sort.
The Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10, Windows 11, and Windows Server 2019 and later.
WSL is designed to provide a seamless experience for developers who want to use both Windows and Linux at the same time. It can be especially helpful for web developers and those working with Bash and Linux-first tools like Ruby and Python. WSL allows users to use their tools on Windows and ensure consistency between development and production environments.
A compatibility layer called Windows Subsystem for Linux allows Linux binary executables (in the ELF format) to operate natively on Windows 10 and Windows Server 2019.
The first version was launched on August 2, 2016, about Seven years ago, and included a Microsoft-developed kernel interface that was compatible with Linux. The intriguing thing is that it supported the majority of native Linux commands even though it lacked true Linux kernel code.
So where exactly did the magic occur?
The Microsoft group has, however, developed a translation layer that sits between user input and the NT kernel. A command that is native to Windows will be sent straight to the Windows kernel, which is already equipped to handle it. In the event that it is a Linux command, the request will be routed to the freshly instantiated process (PICO process) where the Linux instance is hosted after the translation service is contacted. Following execution of the command, the outcome is once more converted into a command that the NT kernel can comprehend
There are two versions of WSL: WSL 1 and WSL 2. Not every Windows 10 user has default access to it.
While this blog will primarily focus on WSL 1, I would like to inform you that WSL 2 was launched on June 12, 2019, The genuine Linux has taken the place of the Linux kernel compatibility layer in the second version! I/O performance has thus increased dramatically!
The way that WSL 2 operates inside a managed virtual machine that has the entire Linux kernel implemented sets it apart from WSL 1. Because not all system calls were implemented in WSL 1, WSL 2 is therefore compatible with a greater number of Linux binaries than WSL 1.
The way that WSL 2 operates inside a managed virtual machine that has the entire Linux kernel implemented sets it apart from WSL 1. Because not all system calls were implemented in WSL 1, WSL 2 is therefore compatible with a greater number of Linux binaries than WSL 1. Customers of Windows 10 can access WSL 2 since June 2019 using the Windows Insider program, even if they have the Home edition.
Key Features of WSL:
- Native Linux Kernel: WSL 2 includes a full Linux kernel, which improves performance and system compatibility over the previous version, WSL 1.
- File System Access: You can access your Windows file system from within the Linux environment and vice versa, allowing for easy file sharing between the two systems.
- Multiple Distributions: WSL supports various Linux distributions like Ubuntu, Debian, Fedora, Kali Linux, and others, which can be installed from the Microsoft Store.
- Integration with Windows: WSL allows for seamless integration with Windows tools. For example, you can use Windows apps to open files from the Linux environment and vice versa.
- Networking: WSL provides full support for networking, meaning you can run network applications or servers within the Linux environment.
- Compatibility: WSL is highly compatible with Linux software, making it easier to develop, test, and run Linux-based applications on a Windows machine.