microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.55k stars 823 forks source link

[error 2147942402 (0x80070002) when launching `ubuntu2204.exe'] launching wsl2 from windows Terminal #11340

Open snowgato opened 8 months ago

snowgato commented 8 months ago

Windows Version

Microsoft Windows [Version 10.0.22631.3296]

WSL Version

2.1.1.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.146.1-2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

I get this error while launching Ubuntu-22.04 as regular user from windows Terminal

Expected Behavior

Launch without error

Actual Behavior

[error 2147942402 (0x80070002) when launching `ubuntu2204.exe']

Diagnostic Logs

I can log in as root, if I rename the regular user .bashrc file, I can then log in as regular user using su. But I still get the error [error 2147942402 (0x80070002) when launching `ubuntu2204.exe'] if I launch Ubuntu from windows Terminal, even if I shutdown wsl.exe and wait for more than a dozen of seconds once renamed .bashrc file of regular user.

Logs WslLogs-2024-03-22_10-25-41.zip

github-actions[bot] commented 8 months ago

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!

Closed similar issues:

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

snowgato commented 8 months ago

Different issues exposed by the bot are not related to mine and of no help to solve it

LukeTheEngineer commented 8 months ago

https://askubuntu.com/questions/1421805/error-2147942402-0x80070002-when-launching-ubuntu-18-04-in-wsl

Does this match your problem?

OneBlue commented 8 months ago

I don't see any WSL logs in the zip file you shared. Can you confirm you reproduce the issue while log collection was running ?

/logs

snowgato commented 8 months ago

https://askubuntu.com/questions/1421805/error-2147942402-0x80070002-when-launching-ubuntu-18-04-in-wsl

Does this match your problem? Hi, No, it doesn't, I haven't added lately any windows PATH.

snowgato commented 8 months ago

I don't see any WSL logs in the zip file you shared. Can you confirm you reproduce the issue while log collection was running ?

/logs

The log app was running when I tried to start ubuntu-22.04. Seems the log app doesn't catch the error.

snowgato commented 8 months ago

Actually I can still log in as regular user from Terminal using powershell for instance typing : wsl.exe -d Ubuntu-22.04 command, but I can't log in anymore directly into wsl from Terminal clicking on the tab + button ( Ubuntu-22.04 is my default Terminal profile )

OneBlue commented 8 months ago

/logs

snowgato commented 8 months ago

image

Hello, I've launched once more the log collector tool. Here is the log file and a screen shot of the admin powershell console from which the log collector was run Thanks for your help ! screen_capture_powershell_administrator_log_collector_launched WslLogs-2024-03-25_23-46-16.zip

github-actions[bot] commented 8 months ago
Diagnostic information ``` .wslconfig found Detected appx version: 2.1.1.0 ```
OneBlue commented 8 months ago

@snowgato: I'm not seeing any WSL logs in the file you shared. Can you confirm that you reproduced the problem while log collection was running ?

snowgato commented 8 months ago

Yes I do confirm I launched the logging tool , waited for the output saying it was logging, then I clicked on Terminal to try to launch Ubuntu and provoking the error and finally I pressed a Key to stop thé logging tool. If there is nothing logged, it means the logging tools is not able to catch that event. In deed the error has come up when the app was logging

OneBlue commented 8 months ago

Thank you @snowgato. Does ubuntu2204.exe even start, or is the error code essentially that this process couldn't be started ?

What's the output of Get-AppxPackage | where {$_.name.contains("Ubuntu")} (powershell)

snowgato commented 8 months ago

As told before, I Can start Ubuntu from powershell using wsl.exe -d Ubuntu-22.04

OneBlue commented 8 months ago

So ubuntu2204.exe doesn't start right ? Then that might be the root cause of issue. You could try repairing the app but I recommend backing off your WSL distro via wsl --export before doing that ?

snowgato commented 8 months ago

But actually, when I use Terminal and click on New tab, the error is instantaneous. This error can occur while Ubuntu is running in an instance launched in a powershell windows with wsl -d Ubuntu-22.04

OneBlue commented 8 months ago

Does ubuntu2204.exe start if you run it directly ?

What's the output of: Get-Item ((Get-Command ubuntu2204.exe).Source) in powershell ?

snowgato commented 8 months ago

Here is the output of powershell cmd Get-AppxPackage | where {$_.name.contains("Ubuntu")} :

RunspaceId : de82ac7f-2349-422f-97b6-09a1ba9034c7 Name : CanonicalGroupLimited.Ubuntu20.04LTS Publisher : CN=23596F84-C3EA-4CD8-A7DF-550DCE37BCD0 PublisherId : 79rhkp1fndgsc Architecture : X64 ResourceId : Version : 2004.6.16.0 PackageFamilyName : CanonicalGroupLimited.Ubuntu20.04LTS_79rhkp1fndgsc PackageFullName : CanonicalGroupLimited.Ubuntu20.04LTS_2004.6.16.0_x6479rhkp1fndgsc InstallLocation : C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu20.04LTS_2004.6.16.0_x6479rhkp1fndgsc IsFramework : False PackageUserInformation : {} IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False Dependencies : {CanonicalGroupLimited.Ubuntu20.04LTS_2004.6.16.0_neutral_split.scale-100_79rhkp1fndgsc, CanonicalGroupLimited.Ubuntu20.04LTS_2004.6.16.0_neutral_split.scale-125_79rhkp1fndgsc, CanonicalGroupLimited.Ubuntu20.04LTS_2004.6.16.0_neutral_split.scale-150_79rhkp1fndgsc} IsPartiallyStaged : False SignatureKind : Store Status : Ok

RunspaceId : de82ac7f-2349-422f-97b6-09a1ba9034c7 Name : CanonicalGroupLimited.Ubuntu22.04LTS Publisher : CN=23596F84-C3EA-4CD8-A7DF-550DCE37BCD0 PublisherId : 79rhkp1fndgsc Architecture : X64 ResourceId : Version : 2204.3.63.0 PackageFamilyName : CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc PackageFullName : CanonicalGroupLimited.Ubuntu22.04LTS_2204.3.63.0_x6479rhkp1fndgsc InstallLocation : C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu22.04LTS_2204.3.63.0_x6479rhkp1fndgsc IsFramework : False PackageUserInformation : {} IsResourcePackage : False IsBundle : False IsDevelopmentMode : False NonRemovable : False Dependencies : {CanonicalGroupLimited.Ubuntu22.04LTS_2204.3.63.0_neutral_split.scale-100_79rhkp1fndgsc, CanonicalGroupLimited.Ubuntu22.04LTS_2204.3.63.0_neutral_split.scale-125_79rhkp1fndgsc, CanonicalGroupLimited.Ubuntu22.04LTS_2204.3.63.0_neutral_split.scale-150_79rhkp1fndgsc} IsPartiallyStaged : False SignatureKind : Store Status : Ok

johanvanhelden commented 8 months ago

I am having the same issue and this worked for me: https://askubuntu.com/a/1486711

Change ubuntu2204.exe to wsl.exe in the settings.

image