Digital Marketing Agency | SEO, Paid Social & PPC

How to install Ubuntu 21.10 on WSL for Windows 11

Share This Post

How to Install Ubuntu on WSL for Windows 11: The Windows Subsystem for Linux (WSL) 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.

You can:

  • Choose your favorite GNU/Linux distributions from the Microsoft Store.
  • Run common command-line tools such as grep, sed, awk, or other ELF-64 binaries.
  • Run Bash shell scripts and GNU/Linux command-line applications including:
    • Tools: vim, emacs, tmux
    • Languages: NodeJS, Javascript, Python, Ruby, C/C++, C# & F#, Rust, Go, etc.
    • Services: SSHD, MySQL, Apache, lighttpd, MongoDBPostgreSQL.
  • Install additional software using your own GNU/Linux distribution package manager.
  • Invoke Windows applications using a Unix-like command-line shell.
  • Invoke GNU/Linux applications on Windows.

What is WSL 2?

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. Its primary goals are to increase file system performance, as well as add full system call compatibility.

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. WSL 2 uses an entirely new architecture that benefits from running a real Linux kernel.

How to Install Ubuntu on WSL for Windows 11

Installing WSL 2 on Windows 10 and 11 is easier than ever, and adding a distro to it requires little more than downloading an app from the Microsoft Store. The Microsoft Store has a good, but limited selection of Linux distros, and in the case of Ubuntu, you are looking at the LTS versions and not the latest rolling releases.

However, this is fine for many, but there will always be good reasons to want access to the latest version, particularly in development. If you need Ubuntu 21.10, there is no need to go off and fire up a virtual machine; you can quite easily install it on Windows 11 or 10.

How to download Ubuntu 21.10 for WSL

To download Ubuntu 21.10 for WSL is not difficult, but it is also not particularly obvious where you even get it. It is possible to upgrade inside WSL to the latest release, but in the case of 21.10, you would need to be on 21.04 already.

In this guide, we are going to show you how to download an image file and install a completely fresh build of Ubuntu 21.10.

To get the files you need, go to the Ubuntu website and follow these steps.

Click on the option labeled impish.
Click on current.
Locate the files labeled wsl.rootfs.tar.gz.

There will be multiple files, but you can ignore the ones labeled with manifest. You also need to choose the right version for your PC. If you are using an Intel-powered or AMD-powered machine, choose the amd64 version and if you are using an ARM-based machine, choose the arm64 version.

Download the relevant file and follow the installation process.

You may also like TPM 2.0: How to fix Windows 11 TPM error

How to install Ubuntu 21.10 on WSL for Windows 10 and 11

Here you are going to be on your PowerShell terminal. You need to take note of where you have downloaded the tar file from the steps above as you will need the file location as part of the install process.

The installation process starts with importing the downloaded image from Ubuntu into your WSL setup.
Inside PowerShell, you will need to enter the following command to import and install Ubuntu 21.10:

wsl –import <name> <location to unpack> <location of download>

wsl –import Ubuntu-2110 c:/WSL/Ubuntu-2110 c:/Downloads/impish-server-cloudimg-amd64-wsl.rootfs.tar.gz

It doesn’t matter where you unpack and install the image, but it does not hurt to create a dedicated directory, especially if you plan on installing multiple distros in this fashion.

Additionally, you can specify a version of WSL at the end with the version flag. It will install to whichever version of WSL your system recognizes as default, but you can alter that at installation to save the need to convert it later on. Simply add a 1 or a 2 after the flag to specify which version you require.

This will take a minute to complete, but once it’s finished you can move on to set up. As this hasn’t been installed from the Microsoft Store, there is no app shortcut created in the Start Menu. You will need to launch it manually with:

wsl -d <distroname>

If you use Windows Terminal, however, and you really should, WSL will automatically add it to the dropdown menu with all the other shells you can open.

You may also like How to Run any Android apps on Windows 11

The basic setup of Ubuntu 21.10

As you have sideloaded Ubuntu 21.10, it doesn’t run through the initial setup process you get when you install Ubuntu from the Microsoft Store. As such you won’t have a user set up, there will only be a root. So you will want to create one and add it to the sudo group:

adduser <yourusername>
usermod -aG sudo <yourusername>

Then switch to that user with:

su <yourusername>

To launch into Ubuntu 21.10 as your new user, from PowerShell enter:

wsl -d <distroname> -u <yourusername>

While not a long process to switch to or enter your new installation as your user instead of root, automating the process is always better. Configuring the default user for a distro installed in this way is a little different from those that have an executable downloaded from the Store.

There are a few different ways you can handle this, but the easiest, and largely safest, is to edit the wsl.conf file on the distro to tell WSL to log you in as your user account instead of root. Open up Ubuntu 21.10 and navigate to the file below. The file likely doesn’t exist at first installation, so let’s get it set up, for this, you will want to stay logged in as root and not your user account.

In the terminal enter cd /etc/
Enter ls to list the contents. If you don’t have wsl.conf we can create one.
Enter touch wsl.conf.
Open the wsl.conf file with nano by entering nano wsl.conf.
Now you’ll need to enter the information needed to tell Ubuntu 21.10 to launch as a user and not root. Enter the following block into the document.

# Set the user when launching a distribution with WSL.
[user]
default=YourUserName
The first line isn’t required, but it’s a good idea to keep comments throughout your wsl.conf file to remind you in plain English what each part does.

You may also like How to enable Auto HDR in Windows 11

Exit nano by pressing Ctrl + X followed by Y and Enter to save the file. Close down WSL entirely, leave it a few seconds, and then when you next boot back into Ubuntu 21.10, you should be a user and not root.

Alternatively, if you are using Windows Terminal, open Settings, find your Ubuntu 21.10 install in the sidebar, and in the command line box ensure this command is stored:

wsl.exe -d <distroname> -u <yourusername>

This will have the same effect once closed down and restarted.

It’s a little more of a process than installing from the Microsoft Store, but it’s not too difficult, and it’s a process you can repeat for future rolling releases or just to have multiple versions of the same distro installed for different purposes.

Would you like to read more about Ubuntu on WSL for Windows 11-related articles? If so, we invite you to take a look at our other tech topics before you leave!

Use our Internet marketing service to help you rank on the first page of SERP.

Subscribe To Our Newsletter

Get updates and learn from the best