How to Install and Use Linux on Windows 11 with WSL

In this post, let’s learn how to install and use Linux on Windows 11 with WSL (Windows Subsystem for Linux). This process enables users to simultaneously access the power of Windows and Linux on a Windows machine. You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 to use the commands of the Linux subsystem.

The Windows Subsystem for Linux (WSL) lets developers install a Linux distribution (such as Ubuntu, OpenSUSE, Kali, Debian, Arch Linux, etc.) and use Linux applications, utilities, and Bash command-line tools directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual boot setup.

This Linux on Windows 11 helps the user to access the Linux environment on the Windows operating system. You don’t need to use any virtual machine or install a separate Linux Operating System on the same device.

Installing WSL through the Microsoft Store will allow you to get the latest WSL updates and features faster and without needing to modify your Windows version. This post is about the installation and use of Linux on Windows 11 with a step-by-step guide using the Elevated Command Prompt.

Patch My PC
How to Install and Use Linux on Windows 11 with WSL -Fig.1
How to Install and Use Linux on Windows 11 with WSL -Fig.1

What is the Windows Subsystem for Linux on Windows 11?

The Windows Subsystem for Linux lets developers run a GNU/Linux environment, including most command-line tools, utilities, and applications, directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual boot setup.

1. WSL 2 is a new version of the Windows Subsystem for Linux architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows.
2. Its primary goals are to increase file system performance and add full system call compatibility

Windows Subsystem for Linux on Windows 11

This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware but still provides the same user experience as in WSL 1 (the current widely available version).

Individual Linux distributions can be run with either the WSL 1 or WSL 2 architecture. Each distribution can be upgraded or downgraded at any time, and you can run WSL 1 and WSL 2 distributions side by side.

Adaptiva
  • WSL 2 uses a new architecture that benefits from running a Linux kernel.

How to Install Linux on Windows 11

You can now install everything you need to run WSL with a single command. Open PowerShell or Windows Command Prompt in administrator mode, enter the wsl -install command, and restart your machine.

Once your machine has finished rebooting, the installation will continue, and you will be asked to enter a username and password. This will be your Linux credential for the Ubuntu distribution. You are now ready to begin using Linux GUI apps on WSL!

The first time you launch a newly installed Linux distribution, a console window will open, and you’ll be asked to wait for files to de-compress and be stored on your machine. All future launches should take less than a second.

wsl –install

How to Install and Use Linux on Windows 11 with WSL -Fig.2
How to Install and Use Linux on Windows 11 with WSL -Fig.2

When you use Linux on Windows 11, some commands are available to perform tasks or any operations. The operations, like as checking the version of WSL installed, version check, etc., are represented in the table; you can find the below commands using the following command:

wsl –help

CommandsDescriptions
wsl –install (options)Install Windows Subsystem for Linux features. If no options are specified, the recommended features will be installed along with the default distribution.
wsl –list –onlineView the default distribution and a list of other valid distributions.
wsl — install –distribution, -d [Argument]Specifies the distribution to be downloaded and installed by name. Here the argument is “a valid distribution name (not case sensitive).”
–inboxInstall the optional Windows feature instead of the version available via the Microsoft Store
–enable-wsl1Enable WSL1 support with the Microsoft Store version
–no-distributionDo not install a distribution (cannot be used with –distribution)
–no-launch, -nDo not launch the distribution after install
–web-downloadDownload the most recent version of WSL from the internet instead of the Microsoft Store
wsl –list, -l [Options]Lists distributions.
–online, -oDisplays a list of available distributions for installation with ‘wsl –install’
–statusShow the status of the Windows Subsystem for Linux
–updateUpdate the Windows Subsytem for the Linux package
–pre-releaseDownload a pre-release version if available, like Implies –web-download
–helpDisplay usage information
How to Install and Use Linux on Windows 11 with WSL -Table 1
How to Install and Use Linux on Windows 11 with WSL -Fig.3
How to Install and Use Linux on Windows 11 with WSL -Fig.3

WSL –install Command

This command is used to install the Windows Subsystem Linux in windows 11, as shown above in fig.2. Now you can see the use of its options with examples in windows 11 shown in the table above.

The command wsl –install (options) can be entered in the Command Prompt like the options are replaced with -d or –distribution shown in the list below:

  • wsl –install -d
  • wsl –install –distribution.

The next command is wsl –install (options) [arguments]; here, you replace the options and arguments and provide the proper command to execute the process perfectly.

  • wsl –install –distribution <distribution name>
  • wsl –install -d <distribution name>

Basic Commands used in Linux on Windows 11

Some basic commands are provided in the WSL for the users to perform their tasks easily. The usage of the wsl.exe syntax is presented below and the arguments for running Linux binaries; if no command line is provided, wsl.exe launches the default shell, shown in the table below:

Syntax: wsl.exe [Argument] [Options…] [CommandLine]

ArgumentsDetails
–exec, -e <commandline>Execute the specified command without using the default Linux shell
–shell-type <type>Execute the specified command with the provided shell type
–shell-type <standard>Execute the specified command using the default Linux shell
–shell-type <login>Execute the specified command using the default Linux shell as a login shell
–shell-type <none>Execute the specified command without using the default Linux shell
Pass the remaining command line as-is
How to Install and Use Linux on Windows 11 with WSL -Table 2

NOTE: In the above table, replace the <type> with <standard>, <login>, and <none> from the argument –shell-type <type>.

As discussed in the arguments above in the table, next is options. There are various options available to process any task. Those are detailed below in the table.

OptionsDescription
–cd <Directory>Sets the specified directory as the current working directory. If ~ is used the Linux user’s home path will be used. If the path begins with a / character, it will be interpreted as an absolute Linux path. Otherwise, the value must be an absolute Windows path.
–distribution, -d <Distro>Run the specified distribution
–user, -u <UserName>Run as the specified user
–systemLaunches a shell for the system distribution
How to Install and Use Linux on Windows 11 with WSL -Table 3

As you saw, the install and help commands above now let’s know about the other controls used in the WSL on windows 11 using an elevated command prompt. The commands are described one by one below:

To update the latest version of Linux on windows 11, use the following command, which helps to update the wsl version installed in your windows device.

wsl –update

How to Install and Use Linux on Windows 11 with WSL -Fig.4
How to Install and Use Linux on Windows 11 with WSL -Fig.4

A command is available to check the current status of the Linux installed on your device. This shows the version used in windows is produced below. Please look at general information about your WSL configuration, such as default distribution type, default distribution, and kernel version.

wsl –status

How to Install and Use Linux on Windows 11 with WSL -Fig.5
How to Install and Use Linux on Windows 11 with WSL -Fig.5

Immediately terminates all running distributions and the WSL 2 lightweight utility virtual machine. This command may be necessary for instances that require you to restart the WSL 2 virtual machine environment, such as changing memory usage limits or your .wslconfig file.

wsl –shutdown

How to Install and Use Linux on Windows 11 with WSL -Fig.6
How to Install and Use Linux on Windows 11 with WSL -Fig.6

View the default distribution and a list of other valid distributions. This shows the list of all the valid distributions available. The following command is used to check the list.

wsl –list –online

NameFriendly Name
UbuntuUbuntu
DebianDebian GNU/ Linux
Kali-LinuxKali Linux Rolling
SLES-12SUSE Linux Enterprise Server v12
SLES-15SUSE Linux Enterprise Server v15
Ubuntu-18.04Ubuntu 18.04 LTS
Ubuntu-20.04Ubuntu 20.04 LTS
Ubuntu-22.04Ubuntu 22.04 LTS
OracleLinux_8_5Oracle Linux 8.5
OracleLinux_7_9Oracle Linux 7.9
How to Install and Use Linux on Windows 11 with WSL -Table 4
How to Install and Use Linux on Windows 11 with WSL -Fig.7
How to Install and Use Linux on Windows 11 with WSL -Fig.7

Check the version information about WSL and its components, where you can see the wsl version, kernel version, etc. are listed below:

wsl –version or wsl -v

  • WSL version: 1.0.3.0
  • Kernel Version: 5.15.79.1
  • WSLg version: 1.0.47
  • MSRDC version: 1.2.3575
  • Direct3D version: 1.606.4
  • DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
  • Windows version:10.0.19045
How to Install and Use Linux on Windows 11 with WSL -Fig.8
How to Install and Use Linux on Windows 11 with WSL -Fig.8

The next command is used to install another distributor from the server; you can keep both in the same Windows machine. This helps you to choose your suitable working environment from the lists of distributors. The command is shown below:

wsl.exe –install Debian

How to Install and Use Linux on Windows 11 with WSL -Fig.9
How to Install and Use Linux on Windows 11 with WSL -Fig.9

The information on How to Install and Use Linux on Windows 11 with WSL is helpful. Please follow us on HTMD Community and visit our website HTMD Forum if you like our content.

Author

Alok is a Master of Computer Applications (MCA) graduate. He loves writing on Windows 11 and related technologies. He likes to share his knowledge, quick tips, and tricks with Windows 11 or Windows 10 with the community.

1 thought on “How to Install and Use Linux on Windows 11 with WSL”

  1. How much RAM to operate both systems? Also may I specify the partion size for Linux?

    Currently on another computer I run Linus 21 Vanessa. I am a ham radio operator and need comports that Windows can give me but wont. Linux is more stable than Windows but there are some programs I have to run on Windows because I can’t get them to run under Linux Wine.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.