Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL broke after Windows update #10831

Closed
1 of 2 tasks
refinedkontrol opened this issue Nov 27, 2023 · 22 comments
Closed
1 of 2 tasks

WSL broke after Windows update #10831

refinedkontrol opened this issue Nov 27, 2023 · 22 comments
Assignees

Comments

@refinedkontrol
Copy link

refinedkontrol commented Nov 27, 2023

Windows Version

Microsoft Windows [Version 10.0.22621.2715]

WSL Version

Cannot determine N/A

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Cannot determine N/A

Distro Version

Cannot determine N/A

Other Software

PS> code --version
1.84.2
1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
x64

Repro Steps

After the following Windows updates, my WSL installation seems to have disappeared. When I run the Ubuntu app, I get this:

(It's repetitive because I followed the prompts to continue/restart.)

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8007019e
Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

Press any key to continue...

[process exited with code 1 (0x00000001)]
You can now close this terminal with Ctrl+D, or press Enter to restart.
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8007019e
Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

Press any key to continue...

[process exited with code 1 (0x00000001)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

I cannot access WSL via VSCode like normal either.

I tried this fix from StackOverflow. I will copy the fix here for the record:

  • Run (Win+R) optionalfeatures.exe
  • untick Windows Subsystem for Linux and click OK Allow the system to restart if prompted
  • Run (Win+R) optionalfeatures.exe again
  • tick Windows Subsystem for Linux and click OK

This will effectively uninstall the WSL and install it again.

The existing WSL installations seem not affected by this procedure in any way (they look exactly like before).

It looks like this commenter on a different StackOverflow question had the same issue.

Expected Behavior

I expected to be able to open the Ubuntu app or the Terminal app and access my WSL command line like normal.

Actual Behavior

Even though I'm running Windows 11, VSCode reports:

Windows Subsystem for Linux not detected. The WSL extension requires Windows 10 with the Windows Subsystem for Linux feature installed.

Source: WSL (Extension)

(For some reason it says Windows 10.)

See additional info under diagnostic logs section...

Diagnostic Logs

I had to answer N/A to a bunch of questions because I couldn't get WSL to give me the information.

Some commands I tried running:

PS> cmd.exe /c ver

Microsoft Windows [Version 10.0.22621.2715]
PS> wsl.exe --version
WSL is finishing an upgrade...
Update failed (exit code: 1603).
Error code: Wsl/CallMsi/E_ABORT
PS> wsl -l -v
WSL is finishing an upgrade...
Update failed (exit code: 1603).
Error code: Wsl/CallMsi/E_ABORT
PS> wsl.exe --status
WSL is finishing an upgrade...
Update failed (exit code: 1603).
Error code: Wsl/CallMsi/E_ABORT
PS> code --version
1.84.2
1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
x64
PS> ver&wsl --list --all -v

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
1      Job1            BackgroundJob   Running       True            localhost            ver
WSL is finishing an upgrade...
Update failed (exit code: 1603).
Error code: Wsl/CallMsi/E_ABORT

PS> wsl.exe --help
WSL is finishing an upgrade...
Update failed (exit code: 1603).
Error code: Wsl/CallMsi/E_ABORT

Windows updates that have been installed since the last time WSL worked for me:

Windows updates screenshot

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@refinedkontrol
Copy link
Author

Additional info:

Ubuntu app info screenshot

Ubuntu (Windows app) version: 2204.2.33.0

@OneBlue
Copy link
Collaborator

OneBlue commented Nov 27, 2023

Thank you @refinedkontrol. Can you try to update to the latest version to be sure that you have it ?

wsl .exe--update --pre-release

@leone93
Copy link

leone93 commented Dec 5, 2023

Same problem to me after that updates. Every time I tried to open later on I have your same error and after some times a blue screen of death appear. Trying to resinstall wsl didn't work at all.

@johrstrom
Copy link

I too have the same issue, using WSL 2.0.9 (I asssume that verion, I can't issue any comamnds successfully, but the binary is in the MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.9.0_x64__8wekyb3d8bbwe folder).

I really only tried to bounce my system as a workaround. I'm a bit hesitant to really mutate my system further, so I haven't reinstalled, edited registry keys or similar system mutations (I'm afraid to lose my data, though if it's inaccessible I suppose what's the worry?).

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 5, 2023

I really only tried to bounce my system as a workaround. I'm a bit hesitant to really mutate my system further, so I haven't reinstalled, edited registry keys or similar system mutations (I'm afraid to lose my data, though if it's inaccessible I suppose what's the worry?).

I would recommend trying to install the latest version of WSL before doing anything like that

@johrstrom
Copy link

I would recommend trying to install the latest version of WSL before doing anything like that

Thanks, I'll try this and let this thread know. (I thought 2.0.9 was the latest and didn't dig any further on it).

@johrstrom
Copy link

I would recommend trying to install the latest version of WSL before doing anything like that

Thanks, I'll try this and let this thread know. (I thought 2.0.9 was the latest and didn't dig any further on it).

I cannot install that msi on this machine (a work machine) apparently. I have admin privileges, but alas get the error, even if I try through an administrative powershell.

image

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 7, 2023

I cannot install that msi on this machine (a work machine) apparently. I have admin privileges, but alas get the error, even if I try through an administrative powershell.

Interesting. Could you try to run (elevated):

msiexec /i path/to/msi /L*V C:\logs.txt

And share C:\logs.txt ?

@johrstrom
Copy link

I ran it and got the logs, but as it's a work machine I'm not entirely sure if I can share it here in it's entirety (I'm asking around for the same).

Is there something specific I can look for/grep to extract?

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 7, 2023

Is there something specific I can look for/grep to extract?

Not easily. The only thing that this log file should contain would be user names and file paths but to root cause I'd need to see the entire file.

You can always redact things that you don't want to share because posting the log file if you want.

@xiaoxi-david
Copy link

Interesting. Could you try to run (elevated):

msiexec /i path/to/msi /L*V C:\logs.txt

And share C:\logs.txt ?

I have the same problem, and I don't mind sharing the file.
logs.txt

@koemaeda
Copy link

koemaeda commented Dec 8, 2023

I am also having this same issue, and installing the latest version (2.0.14) did not help.

When running the MSI with msiexec /i path/to/msi /L*V, it fails at the end:
msi installation logs.txt

When running the MSI with msiexec /a path/to/msi /L*V the installation completes without errors:
msi elevated installation logs.txt

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 8, 2023

I have the same problem, and I don't mind sharing the file. logs.txt

Thank you @xiaoxi-david. Just to confirm, you ran this command as administrator right ? If so, can you please share the output of (elevated powershell):

Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemforLinux -AllUsers

And the content of the registry key: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WSLService ?

@xiaoxi-david
Copy link

Thank you @xiaoxi-david. Just to confirm, you ran this command as administrator right ?

Yes

If so, can you please share the output of (elevated powershell):

Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemforLinux -AllUsers

image

And the content of the registry key: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WSLService ?

image

@refinedkontrol
Copy link
Author

I would recommend trying to install the latest version of WSL before doing anything like that

Thanks, I'll try this and let this thread know. (I thought 2.0.9 was the latest and didn't dig any further on it).

I cannot install that msi on this machine (a work machine) apparently. I have admin privileges, but alas get the error, even if I try through an administrative powershell.

image

I tried the same thing and got the same error.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 8, 2023

Thank you @xiaoxi-david. Looks like you somehow have an older wslservice left behind. Can you try to run (elevated cmd):

sc.exe delete wslservice

And see if that solves the issue ?

@xiaoxi-david
Copy link

Can you try to run (elevated cmd):

sc.exe delete wslservice

I may have to change something first, because I can't run it.
image

@refinedkontrol
Copy link
Author

refinedkontrol commented Dec 12, 2023

Found a way to recover my files ✅

I tried a few other things to fix the issue. Deleted some folders from the registry in an attempt to reinstall WSL. Nothing worked. I suspect I damaged my WSL install further.

Decided to cut my losses...

Retrieved the WSL disk image file from:

C:\Users\my.username\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx

Opened the ext4.vhdx file with Linux Reader by DiskInternals. I cannot vouch for the safety of this software. I ran it in a VM.

That worked and I was able to recover my files.

Lost hope that I can fix WSL on my machine without doing an OS reinstall.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 13, 2023

Can you try to run (elevated cmd):

sc.exe delete wslservice

Ah that's too bad. This might be something that we'll need to do as part of the WSL 2.0 installation logic. I'll update this thread when I'll have more info on the subject;

@benhillis
Copy link
Member

@benhillis
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants