Software & AppsOperating SystemLinux

How To Install Ubuntu 21.10 with WSLg on Windows 11

Ubuntu 19

In this article, we will guide you through the process of installing Ubuntu 21.10 with WSLg on Windows 11. This process involves first installing the base “Ubuntu” distribution (currently 20.04) and then upgrading it to 21.10.

Quick Answer

Yes, it is possible to install Ubuntu 21.10 with WSLg on Windows 11. This involves updating the existing release, removing snapd, modifying the release-upgrades file, upgrading to Ubuntu 21.04, upgrading to Ubuntu 21.10, creating a backup image, and creating new installations from the backup image.

Prerequisites

Before we start, make sure you have the following:

  • A computer running Windows 11
  • Administrator access
  • An internet connection

Step 1: Update the Existing Release

Open Windows Terminal or Command Prompt and run the following command:

sudo apt update && sudo apt upgrade

This command will update the list of available packages and their versions, and then upgrade the installed packages to their latest versions.

Step 2: Remove snapd

The next step is to remove snapd, a package that we don’t need for this process. Run the following command:

sudo apt remove snapd

Step 3: Edit the release-upgrades File

We need to modify the release-upgrades file to change the upgrade prompt setting. Run the following command:

sudo nano /etc/update-manager/release-upgrades

This command opens the release-upgrades file in the nano text editor.

In the file, change the last line to:

prompt=normal

This setting ensures that the system will prompt you for any normal release upgrades.

Step 4: Upgrade to Ubuntu 21.04

Now we will upgrade to Ubuntu 21.04 (Hirsute). Run the following command:

sudo do-release-upgrade

This command starts the release upgrade process.

After the upgrade, exit WSL and restart it by running the following command in PowerShell or Command Prompt:

wsl --terminate Ubuntu

This command stops the Ubuntu WSL instance.

Step 5: Upgrade to Ubuntu 21.10

Finally, we will upgrade to Ubuntu 21.10 (Impish). Run the following command:

sudo do-release-upgrade

Again, this command starts the release upgrade process.

If you encounter unnecessary checks after installing any package, you can remove them by running the following command:

sudo apt purge needrestart

This command removes the needrestart package, which can cause unnecessary checks.

Step 6: Create a Backup Image

After upgrading, it is recommended to create a backup image of your Ubuntu 21.10 installation. This can be done by running the following command:

wsl --export Ubuntu Ubuntu2110_fresh_install.tar

This command exports the Ubuntu WSL instance to a tar file, creating a backup image.

Step 7: Create New Installations

To create new installations from the backup image, create a directory and run the following command:

wsl --import Ubuntu2110Test <directory> Ubuntu2210_fresh_install.tar

This command imports the backup image into a new WSL instance.

Conclusion

You have now successfully installed Ubuntu 21.10 with WSLg on Windows 11. Please note that this solution has been tested on Ubuntu 20.04 and may not work on the Community Preview version of Ubuntu 21.04. There have been reports of issues with the upgrade process on the Community Preview version.

For Docker users, there is a solution available here. Also, there is a known issue with nftables on the Community Preview version of Ubuntu. You can find more information and a temporary solution here.

If you encounter a “No schemas installed” error after upgrading to Ubuntu 21.04 on the Community Preview version, you can resolve it by running sudo apt install gsettings-desktop-schemas. This issue has been reported to the Canonical/Ubuntu WSL team here.

We hope this guide has been helpful. If you have any questions or run into any issues, feel free to leave a comment below.

Can I install Ubuntu 21.10 with WSLg on Windows 10?

No, WSLg is only available on Windows 11.

Can I install Ubuntu 21.10 with WSLg on Windows 11 Home edition?

Yes, you can install Ubuntu 21.10 with WSLg on Windows 11 Home edition. WSLg is available on all editions of Windows 11.

Can I install other Linux distributions with WSLg?

Yes, WSLg is not limited to Ubuntu. You can install other Linux distributions, such as Debian, Fedora, or openSUSE, with WSLg on Windows 11.

Do I need to have administrator access to install Ubuntu 21.10 with WSLg on Windows 11?

Yes, administrator access is required to install and configure WSLg on Windows 11.

Can I install WSLg without upgrading to Ubuntu 21.10?

No, WSLg is only available on Ubuntu 21.10 and later versions. You need to upgrade your existing Ubuntu installation to 21.10 to use WSLg.

Leave a Comment

Your email address will not be published. Required fields are marked *