Microsoft first offered some degree of Linux compatibility through the Windows Subsystem for Linux (WSL) introduced with the Windows 10 Anniversary Update in 2016. This initial version of the utility was not perfect, however. especially since it was using a developed Linux compatible kernel. by Microsoft rather than the genuine article. WSL 2 changed that in June 2019 by incorporating the full Linux kernel directly into Windows 10 through the operating system’s built-in Hyper-V hypervisor.
Installing WSL was a complicated process that involved manually activating various services, downloading the utility, and installing it without much help from Windows. However, that has changed with later versions of Windows 10, and Windows 11 continues to make it easier to use various Linux distributions in a lightweight VM environment. Here’s how to get started using Windows Subsystem for Linux on Windows 10 and Windows 11.
How to install Windows Subsystem for Linux in Windows 11
1. Launch PowerShell or Command Prompt as system administrator. This is most easily accomplished by searching for “PowerShell” or “Command Prompt” on the Start menu. Whichever option you choose, do not just launch the command line by pressing “Enter”, as Windows will not allow you to install WSL as a normal user. Instead, you should click on “Run as administrator” in the search results.
2. Enter the following command:
Assuming you’ve launched PowerShell (as shown in our example) or the Command Prompt as an administrator, this command should automatically enable the services WSL relies on, download the utility, and install whatever it does. needs to function without other input. It also downloads and installs Ubuntu, a popular Linux distribution that can be found in everything from single board computers to corporate servers, by default.
3. Restart your computer. A notification should appear telling you that WSL has been installed and will be available after restarting your PC. You don’t need to restart your system immediately, but if you don’t, WSL will remind you that it needs to be restarted the next time you try to do anything with the utility. So restart as soon as possible.
WSL will install after you restart.
4. Enter a username and password when prompted by WSL. These will be your credentials for WSL only.
What to do if you are told “The requested operation requires elevation”
If you enter “wsl –install” and see an error message like the one below, it is because you are not running PowerShell or Command Prompt as an administrator, and you will need to do so if you want to install WSL. Refer to the first step for how to run the applications as administrator.
How to install different Linux distributions in Windows 11
Ubuntu is the default Linux distro installed with the Windows Subsystem for Linux, but it’s not the only âflavorâ of Linux that supports Microsoft’s functionality. There are two ways to install alternative Linux distributions with their own default user interfaces, preinstalled utilities, and other features: through the command line and through the Microsoft Store.
Option 1: command line
The command line i.e. Command Prompt or PowerShell is the most convenient way to install some of the most popular Linux distributions available today. Microsoft doesn’t allow all distributions to be installed this way, likely because there are too many for the company to offer built-in support, but there are several popular distributions available.
1. Enter the following command:
wsl --list --online
The “wsl” part of the command indicates that we are using the Windows Subsystem for Linux, the “list” is a list of supported Linux distributions, and the “online” specifier indicates the distributions offered by Microsoft rather than the ones that are supported. we already have. running on our PC. This command should return a list of distributions that can be installed via the command line.
2. Enter the following command to install a new distribution:
wsl --install -d
This command tells the Windows Subsystem for Linux to install one of the distributions listed through the previous command. As of this writing, that includes everything from Debian, a distro that prides itself on its stability and provides the foundation upon which distributions like Ubuntu are built, to Offensive Security’s favorite Kali Linux hacker.
Option 2: Microsoft Store
Anyone who isn’t quite comfortable with the command line can still install Linux distributions through the Microsoft Store. This requires a bit more manipulation than the command line, mainly because it involves a graphical user interface rather than a text-based system, but it should be a familiar process to anyone who has ever installed software through a platform. – central distribution form.
1. Open the Microsoft Store. The app is automatically pinned to the Start menu and taskbar on new installations of Windows 11, but if you’ve removed it from those default locations, it’s fairly easy to launch it by searching for “Store” in the start menu.
2. Search for “Linux”. Linux distros do not have a dedicated section of the Microsoft Store at the time of writing, but searching for “Linux” will reveal which distros are available through this point-and-click interface. There are several versions of Ubuntu available for download, for example, as well as distributions such as openSUSE Leap.
3. Click on the distribution you are interested in, then click on “Install”. As long as you’ve created a Microsoft account, the Microsoft Store should handle the rest of the process. Once completed, you will have access to a new distribution through the Windows Subsystem for Linux and one more opportunity to start learning how to use the command line.
How to use Linux GUI based software in Windows 11
WSL originally provided access to Linux command line interfaces, which was probably acceptable to power users, but it was unlikely to make the operating system more accessible to newcomers. (It’s not necessarily in Microsoft’s best interests to convince people that it’s better for them to use a free, open-source operating system instead of Windows.) That has changed, and now is possible to use Linux graphical user interface (GUI) applications on Windows. .
1. Update WSL using the following command:
This will update the Windows Subsystem for Linux so that you can use GUI applications through the utility. Note that Microsoft only offers this functionality through WSL 2; the first iteration of the utility is still limited to non-graphical interfaces which are clearly distinct from Windows itself.
2. Restart wsl typing
3. Install the correct driver for your GPU. Microsoft Links to GPU Driver Installation Instructions for WSL for Intelligence, AMD, and Nvidia GPU. Follow these guidelines to ensure that your discrete graphics card, or the integrated GPU built into your CPU, is optimized to run graphics-based Linux software alongside Windows itself.
4. Install the software you want to use. Linux distributions offer various package managers that can be used to install software through the command line; some also offer central distribution platforms similar to the Microsoft Store where you can find Linux applications. It doesn’t matter which installation method you choose, but you must have something installed. Otherwise, you will be limited to whatever the distro has integrated.
5. Launch the app, then interact with it like any other Windows app. Microsoft designed WSL 2 support for GUI applications to resemble the essential Windows experience. Once the software is launched (usually by entering a program-specific command in a terminal emulator), it can be used with onscreen commands, pinned to the Start menu, added to the taskbar, and treated as a Windows program. typical.
These are the first steps you need to use the Windows Subsystem for Linux. It may take some time to get used to the command line focused tools and Linux peculiarities, but this feature makes it easier than ever to use Linux and Windows based software smoothly.
More Windows 11 tutorials: