Windows Subsystem for Linux (WSL) is a feature of the Microsoft Windows operating system (OS) that allows users to run native Linux command-line tools directly on Windows. WSL 2 is the latest version of WSL and includes significant improvements over the original version, including support for running Linux ELF64 binaries on Windows and better overall performance. Windows Subsystem for Linux (WSL) 2 was first introduced in the Windows 10 May 2020 Update (also known as Windows 10 version 2004). This update was released to the general public on May 27, 2020, and it included a number of new features and improvements, including the ability to use WSL 2. Here are some key differences between WSL 1 and WSL 2:
- Performance: WSL 2 has significantly better performance compared to WSL 1. WSL 2 uses a lightweight virtual machine to run Linux, which allows it to run more efficiently and closer to native speeds.
- File system support: WSL 2 includes support for the Linux file system, which means that you can access your Linux files directly from Windows and vice versa. In contrast, WSL 1 uses a utility called DrvFs to access Linux files, which can lead to slower file access and some compatibility issues.
- Compatibility: WSL 2 supports running ELF64 Linux binaries, which means that it can run a wider range of Linux programs and tools compared to WSL 1.
- Kernel: WSL 2 includes a Linux kernel that is updated regularly, which means that you can use the latest Linux features and technologies. In contrast, WSL 1 does not include a Linux kernel and relies on a compatibility layer to run Linux programs.
Precautions and Potential Safety Issues With Software[edit | edit source]
- Always use caution when downloading unknown software including complete programs, development libraries, and 3rd party code.
Installation[edit | edit source]
The complete installation instructions can be found in the documentation on Microsoft's website.
- Check your Windows version and build, you must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 to use the commands below.
- If you are on earlier versions please see the manual install page on the Microsoft website.
- Open command line by searching for it or pressing "WIN + R" and typing "cmd" and pressing run
- It is suggested to download Windows Terminal from the Windows Store as it greatly improves workflow
- In command line type "wsl --install", by default this will enable the features necessary to run WSL and install the Ubuntu distribution of Linux.
- To install a different distribution add the following flags to the installation command:
- --distribution: To specify which Linux distribution to install, you can find available distributions by running wsl --list --online.
- --no-launch: Install the Linux distribution but do not launch it automatically.
- --web-download: This is used if you wish to install from an online source rather than using the Microsoft Store.
- Windows terminal allows you to open your various distributions as separate tabs in a single window.
- To install a different distribution add the following flags to the installation command:
Operation & Procedure[edit | edit source]
References[edit | edit source]
- Microsoft: WSL Documentation https://learn.microsoft.com/en-us/windows/wsl/
- Wikipedia: Windows Subsystem for Linux https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux