WSL icon indicating copy to clipboard operation
WSL copied to clipboard

wsl Windows Subsystem for Linux Preview shutdown on opening

Open osteopathievilleraymontreal opened this issue 4 years ago • 29 comments

Version

Microsoft Windows [version 10.0.22621.674]

WSL Version

  • [X] 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

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

/logs

OneBlue avatar Oct 17 '22 10:10 OneBlue

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!

ghost avatar Oct 17 '22 10:10 ghost

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

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,

danielvca avatar Oct 18 '22 11:10 danielvca

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.

benhillis avatar Oct 18 '22 19:10 benhillis

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>

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

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 ?

OneBlue avatar Oct 19 '22 15:10 OneBlue

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

@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 ?

OneBlue avatar Oct 20 '22 09:10 OneBlue

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

thank you for taking your time to answer.

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

thanks again

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 avatar Oct 21 '22 09:10 OneBlue

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

Ose-Augustine avatar Nov 18 '22 22:11 Ose-Augustine

Windows é um lixo!

dbsdenis avatar Nov 23 '22 02:11 dbsdenis

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: https://github.com/microsoft/WSL/issues/5923

francesco1119 avatar Jan 03 '23 11:01 francesco1119

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.

kiruanoyuan avatar Jan 10 '23 08:01 kiruanoyuan

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

oneheed avatar Feb 03 '23 14:02 oneheed

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 🙏🙏

AnkhEl avatar Feb 07 '23 10:02 AnkhEl