What to do when an error message is displayed when launching WSL2 Ubuntu and it cannot be started
When installing Ubuntu for WSL2 through the Microsoft Store, you might encounter error messages upon startup. This article explains how to solve such issues.
When you install Ubuntu for WSL2 via the Microsoft Store, there’s a chance you might face error messages upon launch. This article provides guidance on how to address these issues.
Table of Contents here.
- Target Audience
- Environment
- Prerequisites
- Issues with Microsoft Store Installation
- How to Resolve the Issue
Target Audience
- Those encountering error messages when starting WSL2 Ubuntu
Environment
- Windows 10 or newer versions
- A setup where WSL2 can be utilized
Prerequisites
- Activation of the Windows Subsystem for Linux (WSL)
Issues with Microsoft Store Installation
Upon installing Ubuntu for WSL2 via the Microsoft Store, you might see the following error messages, and Ubuntu on WSL2 might fail to start:
Command not found.
Command not found.
Command not found.
Please press any key...
It appears that these issues can arise when installing through the store.
Let’s proceed to the next section to resolve this problem.
How to Resolve the Issue
1. Uninstalling Ubuntu on WSL2
First, uninstall Ubuntu on WSL2.
You can do this either through command-line or via Settings → Apps → Installed Apps.
2. Installing Ubuntu on WSL2 via Command Line
Use the command below to install Ubuntu on WSL2.
In this example, we’re installing Ubuntu 22.04.
wsl --install -d Ubuntu-22.04
Side Note: Checking Available Distributions
If you wish to see a list of available distributions, execute the following command:
wsl --list --online
From the displayed NAME column, specify the name of the distribution you want after the -d flag to install it.