Microsoft first provided a certain degree of Linux compatibility through the Windows Subsystem for Linux (WSL) introduced in the Windows 10 Anniversary Update in 2016. The initial version of the utility is not perfect, especially because it uses a Linux-compatible kernel developed by Microsoft and not genuine. WSL 2 changed this in June 2019, integrating the complete Linux kernel directly into Windows 10 through the operating system’s built-in Hyper-V hypervisor.
Installing WSL used to be a complicated process, requiring manual activation of various services, downloading utilities, and installing without much help from Windows. However, with later versions of Windows 10, this situation has changed, and Windows 11 continues to make it easy to start using various Linux distributions in a lightweight virtual machine environment. Here is how to start using the Windows Subsystem for Linux in Windows 10 and Windows 11.
How to install the Windows Subsystem for Linux in Windows 11
1. Launch PowerShell or Command Prompt as a system administrator. It is easiest to do this by searching for “PowerShell” or “Command Prompt” from the “Start” menu. No matter which option you choose, don’t just press “Enter” to start the command line, because Windows will not let you install WSL as a normal user. Instead, you should click “Run as administrator” from the search results.
2. Enter the following command:
Assuming you started PowerShell (as shown in our example) or command prompt as an administrator, the command should automatically enable the services that WSL depends on, download the utility, and install everything it needs to run without any further enter. By default, it also downloads and installs Ubuntu, a popular Linux distribution that can be found in everything from single board computers to enterprise servers.
3. Restart your computer. A notification should appear, telling you that WSL is installed and available after you restart your PC. You do not need to restart the system immediately, but if you do not, WSL will remind you that you need to restart the system the next time you try to perform any operation with the utility. So restart as soon as it is convenient.
WSL will install itself after you restart.
4. Enter username and password When prompted by WSL. These will only be your WSL credentials.
What to do if you are told that “the requested operation needs to be upgraded”
If you enter “wsl –install” and see the following error message, it is because you are not running PowerShell or Command Prompt as an administrator. If you want to install WSL, you need to do so. For instructions on how to run the application as an administrator, see the first step.
How to install different Linux distributions in Windows 11
Ubuntu is the default Linux distribution installed with the Windows Subsystem for Linux, but it is not the only Linux “flavor” that is compatible with Microsoft features. There are two ways to install an alternative Linux distribution with its own default user interface, pre-installed utilities, and other features: through the command line and through the Microsoft Store.
Option 1: Command line
The command line (ie Command Prompt or PowerShell) is the easiest way to install some of the more popular Linux distributions today. Microsoft does not allow every release to be installed in this way. This may be because the company cannot provide too many releases with built-in support, but there are several popular releases 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 distribution provided by Microsoft, not our existing distribution Version runs on our PC. This command should return a list of releases that can be installed via the command line.
2. Enter the following command to install the new release:
wsl --install -d <Distro>
This command tells the Windows Subsystem for Linux to install one of the distributions listed by the previous command. At the time of writing, this includes everything from Debian (a distribution that prides itself on stability and provides the basis for building distributions such as Ubuntu) to the hacker’s favorite Offensive Security’s Kali Linux.
Option 2: Microsoft Store
Anyone who is not familiar with the command line can still install a Linux distribution through the Microsoft Store. This requires more fiddling than the command line, mainly because it involves a graphical user interface rather than a text-based system, but for anyone who has previously installed software through a central distribution platform, this should be a familiar process.
1. Open the Microsoft Store. On newly installed Windows 11, the application is automatically pinned to the Start menu and taskbar, but if you have deleted it from these default locations, you can easily launch it by searching for “Store” from the Start menu.
2. Search for “Linux”. At the time of writing, there is no dedicated section for Linux distributions in the Microsoft Store, but searching for “Linux” will display the available distributions through this point-and-click interface. For example, there are multiple versions of Ubuntu available for download, as well as distributions such as openSUSE Leap.
3. Click the release you are interested in, and then click Install. As long as you create a Microsoft account, the Microsoft Store should handle the rest of the process. When you are done, you will have a new release that can be accessed through the Windows Subsystem for Linux, and you will also have the opportunity to start learning how to use the command line.
How to use GUI-based Linux software in Windows 11
WSL initially provided access to the Linux command line interface, which may be no problem for experienced users, but it is unlikely to make it easier for new users to access the operating system. (It’s not that persuading people to use a free and open-source operating system instead of Windows is better for them. This is not necessarily in Microsoft’s best interest.) This has changed and it is now possible to use the Linux graphical user interface (GUI) in Windows. ) application.
1. Use the following command to update WSL:
This will update the Windows subsystem for Linux so that you can use GUI applications through the utility. Note that Microsoft only provides this functionality through WSL 2; the first iteration of the utility is still limited to a non-graphics-based interface that is clearly separate from Windows itself.
2. Restart wsl By typing
3. Install the appropriate driver for your GPU. Microsoft links to instructions for installing GPU drivers for WSL Intel, AMD, with Nvidia GPU. Follow these instructions to ensure that your discrete graphics card (or the integrated GPU built into the CPU) is optimized for running graphics-based Linux software and Windows itself.
4. Install the software you want to use. Linux distributions provide various package managers that can be used to install software through the command line; some also provide a central distribution platform similar to the Microsoft Store, where you can find Linux applications. It doesn’t matter which installation method you choose, but you have to install something. Otherwise, you will be limited to whatever is built into the distribution.
5. Start the application, and then interact with it like any other Windows application. Microsoft designed WSL 2 to support GUI applications to resemble a basic Windows experience. Once the software is started (usually by entering program-specific commands in a terminal emulator), it can interact with the use of on-screen controls, pin to the start menu, add to the taskbar, or treat it like a typical Windows program.
These are the first steps required to use the Windows subsystem for Linux. It may take a while to get used to command-line-centric tools and Linux features, but this feature makes it easier than ever to coordinate the use of Linux and Windows-based software.
More Windows 11 tutorials: