The following fail message appeared when I tried installing Ubuntu 22.04 LTS on WSL. I'm not able to type anything, therefore, I'm not able to finish the set up.
Those are the outputs I'm getting from "wsl -l -o" and "wsl -l -v" commands.
This is the Ubuntu-22.04 running after the failed installation.
How can I fix it?
12 Answers
Note: For others who come across this who are experiencing the 0x8027025a error when installing Ubuntu 22.04 in WSL, please note that this answer did not solve the problem for the original poster. I'm leaving it here since it has some background on how the installer works (for troubleshooting), but I would recommend trying my other answer here first.
I'm seeing similar failures (but not this exact error) now on my Windows 10 system (but not, so far, on my Windows 11 system). It installed okay the first time, but after uninstalling and reinstalling (which I do often to try different things to answer questions) I've seen the same message. Potential workarounds below (but no "solution" yet).
Some background -- Ubuntu 22.04 on WSL is the first production version to use the new "Ubuntu WSL Out-of-Box Experience" first seen in the Community Preview. Previous WSL distributions installed from the Microsoft Store used a fairly simple, console-only installer (such as ubuntu.exe) that:
- Unpacked the rootfs tarball into the appropriate location in your
$env:USERPROFILE\AppData\Local\Packages\<package>directory. - Registered the distribution with WSL
- Ran the "initial configuration" stage which asked for the default username and password
- Registered the default username with WSL, which created the appropriate registry entries.
As far as I can tell, that's the order things occurred in.
The new Ubuntu 22.04 installer, on the other hand, seems to:
- Start unpacking the tarball
- Transitions to a graphical "Here's what's great about Ubuntu" rotating billboard.
- Once the rootfs is extracted, registers the distribution with WSL
- Transitions to a TUI (prettified, console menu) configuration stage where you can set your language, username, actual name, password.
- Adds an additional TUI screen that will set some common
/etc/wsl.confoptions. - Registers the username with WSL
- Writes any modified values to
/etc/wsl.conf - Exits the TUI and launches the distribution as your user.
There are several possible failure points (and associated solutions), and probably some I don't know about yet:
Main potential workaround, if user is created
Note that this probably won't work for you, given the output you show in your question, but I'm keeping it here for others:
In my case, I'm usually seeing the problem after Step 6 or 7. When it does transition to the terminal, it thinks that something in the preceding steps hasn't completed successfully. It then attempts to ask for the username and password using the "old method", which fails because it's already been set via the graphical installer.
In this case, you can try closing the existing terminal window and relaunching via
wsl ~ -d Ubuntu-22.04. If it launches as root, check to see if your username exists in/etc/passwd. If it does, set it to be the default bysudo -e /etc/wsl.confand add the entries as specified in this Super User answer (Method 1).I can also reproduce a slightly different failure by the "Help" option, but assuming it's late enough in the process, the same steps above can resolve.
Installer does not complete at all
If the installer fails at an earlier step, you may need to start over. Note that this will completely remove the distribution and all data, so (for other potential readers) only do these steps if you have just installed and failed, with no existing data in Ubuntu 22.04.
Close all installer windows (and any other WSL instances)
Go to PowerShell and:
wsl --shutdown wsl --unregister Ubuntu-22.04 ubuntu2004.exeThe GUI will kick off again. Don't click anything, even when it asks you if you can transition to the next step. It should automatically proceed to
Willkommen! Bienvenue! Welcome! Добро пожаловать! Welkom!where you can select your language.Do not, under any circumstance, select "Help" or the installer will crash again. It may be recoverable, it may not be, but it will crash (in my experience).
Do not use the mouse - This is not a graphical installer at this point -- It is a TUI and will only respond to the keyboard, AFAIK.
Select your language in the TUI using the arrow keys and Enter
Set your username/password in the TUI. Select fields using Tab. Once complete, Tab to the "Done" and hit Enter.
Unless you have a special need, don't change any options on the next screen. "Done" should be selected by default. Just hit Enter
WAIT on the next screen that says "Setup Complete" and "Applying Changes" (conflicting information, IMHO). This step takes far too long, and there's probably something broken "behind" it. Again, do not select "Help" here, or the installer will not completely (in my experience).
Eventually, it will transition to a "Hi " screen. Take not of the instructions on updating, and hit Enter on the "Reboot Now" option.
Hopefully, that will transition to an regular shell at that point.
If not:
One final option
If the above fails, then try a full removal of Ubuntu 22.04 (but not WSL itself):
Optional: Run
RegEditin Windows, navigate toHKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss. Find the entry under with theDistributionNameof "Ubuntu-22.04" (exactly).Take note of it - Don't do anything else. We just want to make sure it gets removed.
Right click on "Ubuntu 22.04" in the Start menu and "Uninstall". Again, this will remove the distribution, so only do this if you have failed installation and have no data in it. Also, please make sure you are removing the correct one - Don't, for instance, remove the wrong "Ubuntu" if you do have multiples installed.
Note that, in the future, the "unversioned Ubuntu" in the Start menu will likely be 22.04 as well for new users (although hopefully these issues are resolved first). Again, make sure you are removing the correct one.
Back in RegEdit, View -> Refresh and confirm that the registry entry is gone. If not, you may need to remove it manually. Note that it was correctly removed for me. I'm just anticipating a case where we really do need to make sure that everything is gone before reinstalling.
Open File Explorer and navigate to
%userprofile%\AppData\Local\Packages\Look for one that starts with
CanonicalGroupLimited.Ubuntu22.04LTS(probablyCanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc). If it doesn't exist, then fine. Previous Ubuntu uninstallers did remove this directory. But it looks like (at least for me) that the 22.04 uninstaller is leaving the virtual disk intact. This is probably a good thing, since we've seen several questions here on AU where people lost data when uninstalling.But if it does still exist after uninstalling, you may want to remove the 22.04 directory manually. You can, if you desire, back up the
..\LocalState\ext4.vhdxfile, but realize that it is about 1.5GB.With all of that complete, a reboot probably wouldn't be a bad idea.
Then go back to the Microsoft Store and try reinstalling Ubuntu 22.04 again, following the directions in the previous step.
For those coming across this error, the following were several ideas to try to fix it. It appears from the comments that the first option, installing as WSL1 and then converting to WSL2, is the easiest workaround for most people. The other two suggestions are only there as a fallback if this isn't a viable solution for you.
Install as WSL1, then convert to WSL2
Ubuntu 22.04 only uses the new TUI configuration step under WSL2. I believe this step is what is failing with The app didn't start in the required time..
Let's see if we can avoid that failure by installing as WSL1. If that works, you can then convert to WSL2.
Uninstall the failed Ubuntu 22.04, again (fun, I know)
Reboot (optional, but recommended)
From PowerShell, run:
wsl --set-default-version 1Run the installer again.
Note that the installer will take much longer to run under WSL1.
If I'm right (and I know I haven't been so far), then this installer will complete successfully. Note that it will skip the TUI configuration of the username/password, along with the optional /etc/wsl.conf step that it runs for WSL2. It will go straight to the console-based username/password configuration. Hopefully, this will allow you to enter it successfully.
If so, and the distribution comes up as your user, then:
- Exit Ubuntu
- Return to PowerShell and run:
wsl --shutdown wsl --set-version Ubuntu-22.04 2 # This will take a while wsl --set-default-version 2 wsl -l -v # Confirm the proper version
If this doesn't work for some reason, then move on to the next options ...
Manually install the rootfs and create the correct user
You might be able to skip straight to the next step, but I'm including this one as the "safe" option of making sure that the rootfs is extracted properly.
Do not uninstall Ubuntu 22.04 this time
Exit any WSL2 distribution
Start an Administrative PowerShell and copy, paste, and run each line individually:
# Edit paths below to your preference $WSL_IMAGE_PATH = "$env:USERPROFILE\WSL\Images" $WSL_INSTANCE_PATH = "$env:USERPROFILE\WSL\Instances" mkdir $WSL_IMAGE_PATH mkdir "$WSL_INSTANCE_PATH\Ubuntu-22.04" $UBUNTU_ROOTFS = (Get-ChildItem -Recurse 'C:\Program Files\WindowsApps\Canonical*22.04*' | Where-Object {$_.Name -eq 'install.tar.gz' })[0].FullName cp "$UBUNTU_ROOTFS" "$WSL_IMAGE_PATH\Ubuntu22.04.tar.gz"Exit the Administrative PowerShell
Start a normal PowerShell and copy, paste, and run each line individually:
wsl --shutdown # Make sure these paths match those created above $WSL_IMAGE_PATH = "$env:USERPROFILE\WSL\Images" $WSL_INSTANCE_PATH = "$env:USERPROFILE\WSL\Instances" wsl --import Ubuntu2204 "$WSL_INSTANCE_PATH" "$WSL_IMAGE_PATH\Ubuntu22.04.tar.gz" --version 2If the image imports successfully, then
wsl ~ -d Ubuntu2204to start it.You should have a similar startup screen that you show above -- You'll be logged in as the root user.
Proceed to the next section (which can be done independently of this one).
Manually create user
From within Ubuntu 22.04
read -p "Username: " NEWUSER
# Enter your desired username
adduser $NEWUSER
# This will create your username/password
usermod -aG adm,cdrom,sudo,dip,plugdev,lxd $NEWUSER
# The following 4 lines must be entered together
cat <<EOF > /etc/wsl.conf
[user]
default=$NEWUSER
EOF
cat /etc/wsl.conf
# Confirm the contentsExit Ubuntu, and from PowerShell:
wsl --terminate Ubuntu2204
wsl ~ -d Ubuntu2204If all went well, you should be in Ubuntu 22.04 as your default user.
5