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

execve("/bin/sh") failed: No such file or directory #1

Open
biopsin opened this issue Dec 26, 2020 · 8 comments
Open

execve("/bin/sh") failed: No such file or directory #1

biopsin opened this issue Dec 26, 2020 · 8 comments

Comments

@biopsin
Copy link

biopsin commented Dec 26, 2020

Hi, was just browsing around and got curious..
But no matter what I try it's always the same issue.

execve("/bin/sh") failed: No such file or directory

Followed and also tried the example, I'm using toybox, but that should not matter.)

@bullno1
Copy link
Owner

bullno1 commented Dec 28, 2020

Can you give a detailed step-by-step instruction of how to reproduce this problem?

@biopsin
Copy link
Author

biopsin commented Dec 28, 2020

I follow the usage https://github.com/bullno1/hako#creating-a-sandbox exactly,
where I do diviate is in the init file where I substitute busybox with toybox and I
exec hako-run as doas instead of sudo for the mount to happen, thats it..
(Edit: I also get same issue using busybox)

@bullno1
Copy link
Owner

bullno1 commented Dec 29, 2020

Is your toybox statically linked?

"No such file or directory" just means the file could not be found.

Can you create a VM image of your environment?

Alternatively, an strace -f of the hako-run command would help.

@biopsin
Copy link
Author

biopsin commented Dec 29, 2020

Tested both dynamic and the attached trace is against static.
Seems it's not mounting, even the init file has 755 bit set, checking with mount after.
trace file @ https://tknk.io/CEGS (link expires in one month)

@bullno1
Copy link
Owner

bullno1 commented Dec 29, 2020

I notice this:

[pid 5108] mount("none", "/media/store/Tmp/sandbox/bin/toybox", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0

What is the exact content of your init script?

@biopsin
Copy link
Author

biopsin commented Dec 29, 2020

#!/bin/sh -e
mount -o ro,bind /media/store/Tmp/toybox-x86_64 ./bin/toybox

@bullno1
Copy link
Owner

bullno1 commented Jan 13, 2021

Where did you get your toybox? I tried using the one from here http://landley.net/toybox/bin/toybox-x86_64, and it works fine. See https://github.com/bullno1/hako/tree/toybox.

cd sandbox
sudo ./start

You will get a toybox shell.
Most commands don't seem to work well in that shell though, could be something with toybox itself.
You can also run busybox with: sudo ./start /bin/busybox sh.

@biopsin
Copy link
Author

biopsin commented Jan 13, 2021

Yes the same, static binary from https://landley.net/toybox/bin/ , while the shared installed using voidlinux.
I will test again this weekend and see if I figure out what the issue is at my end.
Thank you for your time testing it on your end,
I'll close this issue after I make it or not as it's a user error on my part somewhere.

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