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 Windows Subsystem for Linux Preview shutdown on opening #9018

Closed
1 of 2 tasks
osteopathievilleraymontreal opened this issue Oct 15, 2022 · 29 comments
Closed
1 of 2 tasks

Comments

@osteopathievilleraymontreal

Version

Microsoft Windows [version 10.0.22621.674]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.68.1

Distro Version

kali-linux (today Ver)

Other Software

<3>WSL (104) ERROR: CreateProcessEntryCommon: 348: getpwuid(1000) failed 2
<3>WSL (104) ERROR: CreateProcessEntryCommon: 352: getpwuid(0) failed 2
<3>WSL (104) ERROR: CreateProcessEntryCommon: 559: execvpe /bin/sh failed 2
<3>WSL (104) ERROR: CreateProcessEntryCommon: 568: Create process not expected to return

Repro Steps

hello
so i wanted to install kali-linux, so in the microsoft store i install
Windows Subsystem for Linux Preview
and i install right after from the microsoft store
kali linux

when i tried tu run Kali one windows open and desapear as soon
so i tried to ope the Windows Subsystem for Linux Preview from the store and very quick a window open and close with a message i could not read, so i had to film it and make a pause and write it

<3>WSL (104) ERROR: CreateProcessEntryCommon: 348: getpwuid(1000) failed 2
<3>WSL (104) ERROR: CreateProcessEntryCommon: 352: getpwuid(0) failed 2
<3>WSL (104) ERROR: CreateProcessEntryCommon: 559: execvpe /bin/sh failed 2
<3>WSL (104) ERROR: CreateProcessEntryCommon: 568: Create process not expected to return

finally i can't run anything because the windows alway shut down.

What i have done before ?
i was on windows 10, i install Windows Subsystem for Linux Preview and kali and run kali whiout problem. i uninstall them, i update windows 10 to 11 and i install Windows Subsystem for Linux Preview and kali, as the documentation said i change wsl1 to wsl2 and i tried to open kali and problem happen

Thanks for reading all of this
and english is not my language so sorry for the mystakes.

Expected Behavior

unnamed

Actual Behavior

done up

Diagnostic Logs

No response

@osteopathievilleraymontreal
Copy link
Author

the picture is nt good because the windows shutdown quick, i had to film and to pause -- lecture -- pause --lecture -- pause to see the message

@OneBlue
Copy link
Collaborator

OneBlue commented Oct 17, 2022

/logs

@ghost
Copy link

ghost commented Oct 17, 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://raw.githubusercontent.com/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!

@osteopathievilleraymontreal
Copy link
Author

hello
not sure how it works, i execute and here the zip log, but in the power shell it's been written that i have to reproduce the probleme, but it s difficult because it s when i try to open wsl from the microsoft store. maybe there is a command line to open and save a log file in the same time ?

thanks for your answer.
WslLogs-2022-10-17_09-51-39.zip

@danielvca
Copy link

Make sure your distro is set as default. I had some issues where my default distro was assigned to my docker desktop.
open your terminal and type "wsl -l -v" to list your distros then something like this:

wsl --setdefault DISTRO-NAME

Not sure if this will fix your problem but its worth a try,

@benhillis
Copy link
Member

Looks like WSL is configured to launch a user that doesn't exist. I'd suggest running wsl.exe --user root and figuring out what user accounts are actually present in the distro.

@osteopathievilleraymontreal
Copy link
Author

Looks like WSL is configured to launch a user that doesn't exist. I'd suggest running wsl.exe --user root and figuring out what user accounts are actually present in the distro.

i running wsl.exe --user root and here the answer :

C:\WINDOWS\system32> wsl.exe --user root
Processing fstab with mount -a failed.

<3>WSL (8) ERROR: CreateProcessEntryCommon:327: getpwnam(root) failed 2
Utilisateur introuvable.
Error code: Wsl/WSL_E_USER_NOT_FOUND
PS C:\WINDOWS\system32>

@osteopathievilleraymontreal
Copy link
Author

utilisateur introuvable = user unknown

Make sure your distro is set as default. I had some issues where my default distro was assigned to my docker desktop. open your terminal and type "wsl -l -v" to list your distros then something like this:

wsl --setdefault DISTRO-NAME

Not sure if this will fix your problem but its worth a try,

here the answer
C:\WINDOWS\system32> wsl --setdefault kali-linux
L’opération a réussi.

l'operation a reussi = it worked

but still the same problem

@OneBlue
Copy link
Collaborator

OneBlue commented Oct 19, 2022

Thanks for sharing this @osteopathievilleraymontreal.

I wonder if the issue is that the /etc/passwd is corrupted or missing. Can you share the output of wsl --system -d kali-linux-u root cat /mnt/wslg/distro/etc/passwd ?

@osteopathievilleraymontreal
Copy link
Author

C:\WINDOWS\system32> wsl --system -d kali-linux-u root cat /mnt/wslg/distro/etc/passwd
Il n’existe aucune distribution avec le nom fourni.
Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND

Il n’existe aucune distribution avec le nom fourni. = no dristo related to the name given

@ghost ghost removed the needs-author-feedback label Oct 19, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented Oct 20, 2022

@osteopathievilleraymontreal Sorry I made a typo.

Can you please share the output of wsl --system -d kali-linux -u root cat /mnt/wslg/distro/etc/passwd instead ?

@osteopathievilleraymontreal
Copy link
Author

PS C:\Users\Olys> wsl --system -d kali-linux -u root cat /mnt/wslg/distro/etc/passwd
cat: /mnt/wslg/distro/etc/passwd: No such file or directory

@osteopathievilleraymontreal
Copy link
Author

thank you for taking your time to answer.

also if there is a way to uninstall properly maybe could be a solution ?

thanks again

@OneBlue
Copy link
Collaborator

OneBlue commented Oct 21, 2022

Ok that makes sense. It looks like your distribution is corrupted and if /etc/passwd is missing a lot of things won't work.

The easiest way to fix this would be to uninstall and reinstall the distribution. To do this you can use wsl.exe --unregister kali-linux.

If you need to recover files from your distribution before deleting it, you can try \\wsl.localhost, or if that doesn't work, you can mount the distribution vhd in another distribution with wsl --mount

@OneBlue OneBlue closed this as completed Oct 21, 2022
@Ose-Augustine
Copy link

Hi please someone help. I tried installing wsl using the command wsl --install on cmd and i keep getting A system shutdown is in progress. My PC meets the requirement as stated on learn.microsoft. I dont know whats goin on

@dbsdenis
Copy link

Windows é um lixo!

@francesco1119
Copy link

The problem is that the only WSL installed is the one provided by Docker.
You should instead install Ubuntu or Debian from the Marketplace and then follow there instructions: #5923

@kiruanoyuan
Copy link

Im facing this error, after following an online solution to run composer in bash with Windows PHP and composer settings (Changing Distribution WSL version and etc).

But after I change the registry Flags to decimal 15 for : Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss(DistributionUID)\Flags

Problem solved, my Ubuntu running again via WSL

I dont know if you are facing the same problem, but hope it can lead to something with your problem.

@oneheed
Copy link

oneheed commented Feb 3, 2023

Hi you can try command ' wsl -l ' see
Windows Subsystem for Linux Distributions defalut setting
if docker-desktop-data (Default), you can command ' wsl --setdefault DISTRO-NAME' change defalut setting to wish linux

image

@AnkhEl
Copy link

AnkhEl commented Feb 7, 2023

Ok that makes sense. It looks like your distribution is corrupted and if /etc/passwd is missing a lot of things won't work.

The easiest way to fix this would be to uninstall and reinstall the distribution. To do this you can use wsl.exe --unregister kali-linux.

If you need to recover files from your distribution before deleting it, you can try \\wsl.localhost, or if that doesn't work, you can mount the distribution vhd in another distribution with wsl --mount

This helped solve my problem thank you so much 🙏🙏

@TALIS-PRO
Copy link

TALIS-PRO commented Mar 11, 2023

uninstall and reinstall the distribution
wsl.exe --unregister Ubuntu

This helped solve my problem thank you so much

@Ose-Augustine
Copy link

Im facing this error, after following an online solution to run composer in bash with Windows PHP and composer settings (Changing Distribution WSL version and etc).

But after I change the registry Flags to decimal 15 for : Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss(DistributionUID)\Flags

Problem solved, my Ubuntu running again via WSL

I dont know if you are facing the same problem, but hope it can lead to something with your problem.

Thanks for the info. It did work for me but I already had a hypervisor installed (Oracle VM).

@qianwangali
Copy link

i had a same quesiton, finally ,I solved the problem with this command "wsl --setDefault ubuntu"

@coderboy-exe
Copy link

Make sure your distro is set as default. I had some issues where my default distro was assigned to my docker desktop. open your terminal and type "wsl -l -v" to list your distros then something like this:

wsl --setdefault DISTRO-NAME

Not sure if this will fix your problem but its worth a try,

You are the single greatest human in the world! Thank you so much for this!!!

@milosrs
Copy link

milosrs commented Sep 21, 2023

For me, restarting the subsystem did the job

  1. Run wsl -l -v to find the default distro:
  Ubuntu                 Running         2
* docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2
  1. First mistake is that docker-desktop was set as default. Run wsl --set-default {YOUR_DISTRO}
  2. If you still get errors, that may be because YOUR_DISTRO is running like in my case.
  3. Run wsl -t YOUR_DISTRO
  4. Reconnect. Everything should work now.

@robertosoares
Copy link

Make sure your distro is set as default. I had some issues where my default distro was assigned to my docker desktop. open your terminal and type "wsl -l -v" to list your distros then something like this:

wsl --setdefault DISTRO-NAME

Not sure if this will fix your problem but its worth a try,

Isso funcionou para mim.
Muito obrigado!

@jiyuchen1
Copy link

jiyuchen1 commented Feb 22, 2024

我遇到了同样的问题,解决办法:关闭linux子系统,卸载Docker-Desktop,并且删除wsl的更新包,安装重新打开linux子系统,先安装ubuntu,然后再安装Docker-Desktop。具体原因应该是Docker-Desktop导致的,他替换或覆盖了windows的bash和wsl,只要开启子系统之后先安装一个linux子系统,然后在安装docker-Desktop就不会出问题了。

@jiyuchen1
Copy link

jiyuchen1 commented Feb 22, 2024

我的现象:windows11下运行bash或者wsl命令报错,控制台打印如下:

C:\Users\zbf>bash
<3>WSL (11) ERROR: CreateProcessParseCommon:708: Failed to translate C:\Users\zbf
<3>WSL (11) ERROR: CreateProcessParseCommon:754: getpwuid(0) failed 2
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\system32
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\System32\Wbem
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\System32\WindowsPowerShell\v1.0\
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\WINDOWS\System32\OpenSSH\
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Java\jdk1.8.0_131\bin
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate D:\DevelopTools\apache-maven-3.9.0\bin
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate D:\DevelopTools\apache-tomcat-9.0.27\bin
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\WinRAR
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate D:\MicrosoftVSCode\bin
<3>WSL (11) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\NVIDIA Corporation\Nsight Compute 2023.1.0\

但是bash或者wsl添加参数使用的时候是正常的。

@tailanpatrick
Copy link

Certifique-se de que sua distribuição esteja definida como padrão. Tive alguns problemas em que minha distribuição padrão foi atribuída à área de trabalho do Docker. abra seu terminal e digite "wsl -l -v" para listar suas distros e algo assim:

wsl --setdefault DISTRO-NAME

Não tenho certeza se isso resolverá seu problema, mas vale a pena tentar,

Genial, já estava sem opções para resolver o problema.
Obrigado!

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