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 (13) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: Permission denied #12212

Open
1 of 2 tasks
ket000 opened this issue Oct 28, 2024 · 8 comments
Open
1 of 2 tasks

Comments

@ket000
Copy link

ket000 commented Oct 28, 2024

Windows Version

Microsoft Windows [Version 10.0.19045.5011]

WSL Version

2.3.24.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2

Distro Version

Oracle Linux 7.9

Other Software

When trying to launch any wsl distro it gives the below message
WSL (13) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: Permission denied

wsl -u root works fine.

It seems that it can not navigate to /mnt/c folder

<3>WSL (36) ERROR: CreateProcessCommon:551: chdir(/mnt/c/) failed 13
<3>WSL (36) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: Permission denied

Repro Steps

Launch the distro by running
wsl

Expected Behavior

Able to access any distro using normal user.

Actual Behavior

<3>WSL (36) ERROR: CreateProcessCommon:551: chdir(/mnt/c/) failed 13
<3>WSL (36) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: Permission denied[WslLogs-2024-10-28_05-11-41.zip]

Diagnostic Logs

WslLogs-2024-10-28_05-11-41.zip

Copy link

View similar issues

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!

Open similar issues:

Closed similar issues:

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

Diagnostic information
Detected appx version: 2.3.24.0

@ket000
Copy link
Author

ket000 commented Oct 28, 2024

Other issues does not seems to be applicable here. All of this was working till the last Month October update gor installed. I see below updates were installed.

PC Update KB5043130 NT AUTHORITY\SYSTEM 10/8/2024 12:00:00 AM
PC Update KB5044029 NT AUTHORITY\SYSTEM 10/10/2024 12:00:00 AM
PC Security Update KB5044273 NT AUTHORITY\SYSTEM 10/10/2024 12:00:00 AM

@ket000
Copy link
Author

ket000 commented Oct 28, 2024

I installed a new distro OracleLinux_8_7 and it worked fine. So it seems that something specific to older distros

wsl --list --verbose
NAME STATE VERSION

  • OracleLinux_8_7 Running 2
    Legacy Stopped 1
    Ubuntu-18.04 Stopped 1
    Ubuntu Stopped 1
    OracleLinux_7_9 Stopped 2

Also I can login using root

wsl -d OracleLinux_7_9 -u root

but I can not do anything like becoming another user etc.

@benhillis
Copy link
Member

It looks like the permissions on your distro might be messed up. Could you share the output of stat /bin/bash and cat /etc/passwd and the contents of /etc/wsl.conf if present?

@ket000
Copy link
Author

ket000 commented Oct 29, 2024

[root@david-pc local]# stat /bin/bash
File: ‘/bin/bash’
Size: 964536 Blocks: 1888 IO Block: 4096 regular file
Device: 830h/2096d Inode: 147794 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2024-10-29 19:32:32.313190494 -0400
Modify: 2021-11-23 12:44:46.000000000 -0500
Change: 2024-10-28 03:50:34.772463874 -0400
Birth: -
[root@david-pc local]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
david:x:1000:1000::/home/david:/bin/bash
tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/var/lib/oprofile:/sbin/nologin
[root@david-pc local]# cat /etc/wsl.conf
[automount]
enabled = true

@OneBlue
Copy link
Collaborator

OneBlue commented Nov 5, 2024

Interesting, everything looks normal here. let's see which default uid this distribution is running with. What's the output of id -u and strace -f /bin/bash -c echo ok ?

@ket000
Copy link
Author

ket000 commented Nov 11, 2024

# trying to launch without specifying the id lauches with default user and fails.
wsl -d OracleLinux_7_9
<3>WSL (40) ERROR: CreateProcessCommon:551: chdir(/mnt/c/Users/KETANKUMAR) failed 13
<3>WSL (40) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: Permission denied

#trying to start with root works
wsl -d OracleLinux_7_9 -u root
id -u
0

Can not run below as strace is not installed

strace -f /bin/bash -c echo ok

also I can not install strace

sudo yum install strace
sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

@OneBlue
Copy link
Collaborator

OneBlue commented Nov 13, 2024

@ket000: What if you try to launch without a shell ? Something like: wsl -d OracleLinux_7_9 id -u ?

Also, can you share the contents of /etc/fstab ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants