145

I have Ubuntu 22.04 app installed on top of Windows. It worked fine until one day it crashed and now all I get is this error code when I try to start Ubuntu on windows.

Error: 0x80040326
Error code: Wsl/Service/0x80040326
Press any key to continue...

I'm running windows powershell version 2

 wsl --list --verbose
  NAME            STATE           VERSION
* Ubuntu-22.04    Running         2

I'm using Microsoft Office Home 10.0.22621 Build 22621

Any thoughts on what I can do? Google doesn't have many hits for "0x80040326"

Installing a fresh copy doesn't work:

Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: xxxxx
New password:
Retype new password:
Sorry, passwords do not match.
passwd: Authentication token manipulation error
passwd: password unchanged
Try again? [y/N] y
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
Error: 0x80040326
Error code: Wsl/Service/0x80040326
Press any key to continue...
1
  • 2
    "I'm running windows powershell version 2". No, you're running WSL (Windows Subsystem for Linux) version 2. "I'm using Microsoft Office Home 10.0.22621 Build 22621". No, you're using Windows 11 Version 10.0.22621 (Build 22621). I know this sounds pedantic, but my intentions are good: Getting these things right will help you a lot when googling for solutions to your problems.
    – Heinzi
    Apr 1, 2023 at 16:51

10 Answers 10

226

I had a same problem, but just solved it.

Update your wsl system.

wsl --update
6
  • 13
    I had to do it multiple times
    – Devashish Prasad
    Mar 30, 2023 at 4:07
  • Following up to @user541686. Plus the MS Store version has lots of annoying unsolved issues: github.com/microsoft/WSL/issues/9231
    – huyz
    Mar 30, 2023 at 7:22
  • 1
    Also worked for me and, although the update was quick, I still had to wait a few minutes for Windows pop up a notification stating the Update was completed until it started working again.
    – tekneee
    Mar 30, 2023 at 7:37
  • 1
    solved by pressing 'repair' in the wsl settings menu
    – Jeroen Verfaillie
    Mar 30, 2023 at 8:00
  • Also: don't use again 'wsl.memory', 'wsl.processors' or 'wsl.localhostForwarding' in your .wslconfig (they don't work anymore for some reason)
    – mbianchidev
    Mar 30, 2023 at 10:32
16

Windows updates are notorious for breaking things in the background.

The best way to fix this issue will be:

  1. Open a PowerShell or Command Prompt window in Administrator mode
  2. Run the command wsl.exe --update
  3. Run wsl.exe again to see if you can access your default WSL distro otherwise reboot your laptop or desktop and that will fix the issue

Alternatively, you can also rollback the kernel version to establish a working subsystem with the command wsl.exe --update --rollback

1
  • This didn't immediately work for me, I had to restart WSL. wsl --shutdown and then launching another terminal. Note that this will likely kill any processes that were previously running in WSL, but at this point you probably can't touch/save them anyway.
    – Sammitch
    Mar 30, 2023 at 19:48
9

Got the same issue after updating windows yesterday.

wsl --update

This worked as others have said, however it still crashed when trying to start wsl right after running the command. Started working in like a minute or so after running the wsl update, not sure if there was some background process running or something...

0
3

I started having this issue today, this worked for me.

netsh winsock reset

then restart computer

from this issue: https://github.com/microsoft/WSL/issues/9331#issuecomment-1356896162

0
2

For people facing issues downloading from the Microsoft Store:

wsl --update --web-download

Will download from GitHub instead.

0
1

In my case I had to restart the following service to make it work:

  1. LxsxManager
  2. HV Host Service
1

For me, just WSL --update did not work, but going into Apps and doing repair worked:

  • Apps > Installed Apps > Windows Sybsystem for Linux... > Modify > Repair
1

Problem: I was getting following error while launching ubuntu-22.04

Error: 0x80040326
Error code: Wsl/Service/0x80040326

Reason: Ubuntu needed update

Solution: open command prompt in normal or admin mode

run command in command prompt to check ubuntu installed version(optional)

 wsl -l -v

Now, run below command to update ubuntu to latest

 wsl --update

Its Done. Below is my command prompt output in non-admin mode, for reference.

Command prompt output:

C:\Users\Brij>wsl -l -v
  NAME                         STATE           VERSION
* Ubuntu-22.04                 Running         2
  docker-desktop-data          Running         2
  docker-desktop               Running         2

C:\Users\Brij>wsl --update
Checking for updates.
Updating Windows Subsystem for Linux...^C
C:\Users\Brij>
1
0
  • wsl --update
  • wsl --shutdown
  • waiting one Minute
  • start your WSL (e.g. Ubuntu)

this answer is based on https://github.com/microsoft/WSL/issues/9867#issuecomment-1489633480

0

You can also resolve this by uninstalling the WSL app and just using the built-in OS version.

To do this, you can right-click it in the Start Menu and click Uninstall.

Alternatively, you can remove it in Apps & Features.

You must log in to answer this question.