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

ERROR: CreateProcessEntryCommon - unable to login to WSL after import #11343

Closed
1 of 2 tasks
BeErikk opened this issue Mar 22, 2024 · 9 comments
Closed
1 of 2 tasks

ERROR: CreateProcessEntryCommon - unable to login to WSL after import #11343

BeErikk opened this issue Mar 22, 2024 · 9 comments

Comments

@BeErikk
Copy link

BeErikk commented Mar 22, 2024

Windows Version

Microsoft Windows [Version 10.0.22631.3296]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 4.4.0-22621-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #2506-Microsoft Fri Jan 01 08:00:00 PST 2016

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

New computer, new Windows 11 Pro instance, no insider versions.
I have one distribution installed, Ubuntu WSL1, previously created in Windows 10. It was created manually using "the server method" outside the system disk.

Distro imported by:
wsl.exe --import distro "<path>\distro" "<path>\distro.tar"

There is a /etc/wsl.conf with
[user]
default=username

Expected Behavior

wsl ~ -u username
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 4.4.0-22621-Microsoft x86_64)
...

Actual Behavior

wsl ~ -u username
<3>WSL (95) ERROR: CreateProcessEntryCommon:496: chdir(/home/username) failed 13
<3>WSL (95) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 13
<3>WSL (95) ERROR: CreateProcessEntryCommon:508: Create process not expected to return

Diagnostic Logs

No response

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.

@BeErikk
Copy link
Author

BeErikk commented Mar 22, 2024

The first error seems to be while trying to change WSL directory to the current directory of execution.

@BeErikk
Copy link
Author

BeErikk commented Mar 22, 2024

Logging in as root with
wsl.exe ~ -u root
works as expected.

@BeErikk
Copy link
Author

BeErikk commented Mar 22, 2024

I also tried to create a new user account by as root issue
useradd --create-home --shell /usr/bin/bash --user-group --groups adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev --password $(read -sp Password: pw ; echo $pw | openssl passwd -1 -stdin) newuser
then
wsl ~ -u newuser

Same result.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 22, 2024

Thank you @BeErikk. Based on the output it looks like your distro might be missing some files.

What's the output of wsl -d <distro> -u root file /bin/bash and wsl -d <distro> -u root ls -la /home ?

@BeErikk
Copy link
Author

BeErikk commented Mar 23, 2024

Thanks for answering @OneBlue!

wsl.exe -d ubuntu-wsl1 -u root file /bin/bash
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 4.4.0-22621-Microsoft x86_64)
...

wsl.exe -d ubuntu-wsl1 -u root ls -la /home
total 0
d--------- 1 root root 4096 Mar 22 15:20 .
drwxr-xr-x 1 root root 4096 Jan 1 1970 ..
drwxr-x--- 1 BeErikk BeErikk 4096 Mar 22 15:20 BeErikk
d--------- 1 root root 4096 Mar 2 12:09 <realuser>

BeErikk is the extra user account I tried to add, <realuser> is my Windows account name. Computer and <realuser> are also part of Active Directory.

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 26, 2024

Ok so it looks like 'username', which is what wsl.conf points to doesn't exist. You need to update /etc/wsl.conf to map to a user that actually exists and that has a home directory (like BeErikk or ).

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 26, 2024

What was the output of:

useradd --create-home --shell /usr/bin/bash --user-group --groups  adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev --password $(read -sp Password: pw ; echo $pw | openssl passwd -1 -stdin) newuser

? This command might have just failed and ended up not actually creating the account

@BeErikk
Copy link
Author

BeErikk commented Mar 31, 2024

Thanks very much @OneBlue!

I think even if I now have a new machine and upgraded to Windows 11, my Windows username is exactly the same since it is stored in Active Directory (if it matters) and that name is also the name I used in WSL. Everything in WSL should be as I left it on my old Windows 10 machine. The migration should work as I understand it. It didn't and I resorted to installing a new WSL 1 Ubuntu instance.

Again thank you for your effort!

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

2 participants