Microsoft makes it easy to install the Windows for Linux subsystem in Windows 11 and carries this feature back to Windows 10 from version 2004

WSL 2 (Windows Subsystem For Linux 2) is a version of the architecture that allows the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This architecture, which uses a real Linux kernel, changes the way these Linux binaries interact with Windows and your computer hardware, while providing the same user experience as in WSL 1. WSL 2 offers much better file system performance. speed and full system call compatibility, allowing you to run more applications like Docker!

WSL 2 therefore includes a real Linux kernel which allows you to run more Linux software on Windows and offers better performance than WSL 1.

WSL 2 uses Hyper-V functionality to create a lightweight virtual machine with a minimal Linux kernel. Expect better compatibility with Linux software, including Docker support, and a dramatic increase in file system performance.

The virtual machine will automatically launch on startup and use some memory in the background, but Microsoft promises that it has a small memory footprint. You can run the wsl –shutdown command if you want to shutdown the virtual machine in the background.

The Windows for Linux subsystem has evolved tremendously over the years, and with WSL2 things got really impressive. But to take advantage of all that WSL2 has to offer, you need to have it installed, and this is something Microsoft has recognized as so needlessly complicated.

So the company did something. In the latest Windows 11 and Windows 10 Preview, you don’t have to go through endless circles to install WSL2; a single command is now sufficient: wsl.exe –install..

In a Windows Command Line blog post, Craig Loewen, Program Manager for the Windows Development Platform, explains:

See also  Is virtual reality our inevitable future? in

In the latest versions of Windows Insider Preview, you can install everything you need to run WSL by simply running wsl.exe –install. We are thrilled to announce that this feature is now officially reintroduced to Windows 10 version 2004 and later, which will make it much easier to install WSL on these versions!

The WSL setup process was previously too complicated, involving enabling multiple settings and installing multiple packages. We’ve made the single command process simple, just open a Command Prompt window with administrator privileges and run wsl.exe –install. Once you press Enter, the process will automatically activate the optional WSL required features, install the default Ubuntu distribution, and install the latest version of the WSL Linux kernel on your machine. When it’s done and you restart your machine, your distribution will start after rebooting, completing the installation.

Additionally, you can find a list of Linux distributions available for installation by entering the command wsl –list –online in PowerShell or the Windows Command Prompt. To install another distribution or in addition to the default Ubuntu distribution, use this command: wsl –install -d Replace by the name of a Linux distribution found in the preceding list command. This install command can be used for the first time installation or to add additional distributions after already installing WSL with the default Ubuntu distribution.

But Microsoft also offered additional commands:

We have also included additional commands to help you manage your WSL instances with this backport.

You can use wsl –update to manually update your WSL Linux kernel, and you can use wsl –update rollback to revert to a previous version of the WSL Linux kernel.

See also  The Windows XP system is nearly 20 years old, and its market share is still higher than Vista | T客邦

Finally, you can use wsl –status to display general information about your WSL configuration, such as the default distribution type, default distribution, and kernel version.

You must be running Windows 10 version 2004 (the version with which WSL 2 was shipped) or higher and have installed the KB5004296 update to take advantage of this new WSL single command installation procedure:

You can get this backport just by updating Windows as usual. To do this manually, open Windows settings, navigate to “Updates & Security” and press “Check for updates”.

This update is part of KB5004296 and you can find full instructions on how to make sure you’ve installed it and its changes here. At time of writing when you click “Check for Updates” you may see an optional update available, make sure it has the same number as KB5004296, install it and you will have access wsl –update .

Here are some other WSL commands that you might find useful:

wsl –set-version Use this command to convert a distribution using the WSL 2 architecture or the WSL 1 architecture.

: the specific Linux distribution (for example Ubuntu)

: 1 or 2 (for WSL 1 or 2)

wsl –set-default-version Changes the default installation version (WSL 1 or 2) for new distributions.

wsl –shutdownImmediately stop all running distributions and the WSL 2 Lightweight Utility VM.

The virtual machine that powers the WSL 2 distributions is something we want to manage entirely for you. So we pop it up when you need it and close it when you’re done. In some cases, you may want to stop it manually. This command allows you to do this by terminating all distributions and shutting down the WSL 2 virtual machine.

See also  Mobile News IT News - Siamphone News

wsl –list –quietList only distribution names.

This command is useful for scripting, as it only outputs the names of the distributions you have installed without displaying other information such as the default distribution, versions, etc.

wsl –list –verboseDisplays detailed information about all distributions.

This command lists the name of each distribution, the status of the distribution, and the version it is running. It also indicates the default distributions with an asterisk.

Source : Microsoft

Leave a Comment