proot + busybox / Ubuntu - can't chdir("/home/user/Downloads/Proot/./.") in the guest rootfs
0
votes
1
answer
51
views
I'm trying to proot absolutely minimal environment in Ubuntu (as an initial step for further activities), but I can't solve following error:
proot warning: can't chdir("/home/user/Downloads/Proot/./.") in the guest rootfs: No such file or directory
proot info: default working directory is now "/"
proot error: execve("/bin/sh"): No such file or directory
proot info: possible causes:
* the program is a script but its interpreter (eg. /bin/sh) was not found;
* the program is an ELF but its interpreter (eg. ld-linux.so) was not found;
* the program is a foreign binary but qemu was not specified;
* qemu does not work correctly (if specified);
* the loader was not found or doesn't work.
fatal error: see proot --help
.
Proot root directory is initialized using following commands:
mkdir -p ./001_busybox/{bin,etc,lib,proc,sys,tmp,dev}
cp /bin/busybox ./001_busybox/bin
cd ./001_busybox/bin
./busybox --install -s .
cd ../lib
mkdir ./x86_64-linux-gnu
cp /lib/x86_64-linux-gnu/libc.so.6 ./x86_64-linux-gnu/
cp /lib/ld-linux.so.2 .
Then I try to proot using commands:
export PROOT_NO_SECCOMP=1
unset LD_PRELOAD
proot -0 -b /dev -b /proc -b /sys -r ./001_busybox /bin/sh
I've tried many combinations found in Google (including using / not using PROOT_NO_SECCOMP
and LD_PRELOAD
variables - e.g. PROOT_NO_SECCOMP
should be just a workaround for kernel bug on obsolete 32-bit platforms, it's probably not needed more), but without any success.
Problem is, that on another PC with 32-bit Ubuntu exactly the same steps work perfectly fine, just directory i386-linux-gnu
is used instead of x86_64-linux-gnu
.
So I can't understand why it works on 32-bit platform, but not on 64-bit Ubuntu.
Issue is probably not caused by Busybox which I try to start since strace reports it can't change directory (= one step before executing the shell):
execve("/usr/bin/proot", ["proot", "-0", "-r", "./001_busybox", "/bin/sh"], 0x7ffd018c6300 /* 64 vars */) = 0
brk(NULL) = 0x55d7d7a0b000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe786a9c00) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=143139, ...}) = 0
mmap(NULL, 143139, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fefe1fa8000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libtalloc.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 4\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=67664, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fefe1fa6000
mmap(NULL, 69712, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fefe1f94000
mmap(0x7fefe1f97000, 40960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fefe1f97000
mmap(0x7fefe1fa1000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7fefe1fa1000
mmap(0x7fefe1fa4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7fefe1fa4000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300A\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0W\222s/x1X\306o\264\363udX\312$"..., 68, 880) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2029592, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0W\222s/x1X\306o\264\363udX\312$"..., 68, 880) = 68
mmap(NULL, 2037344, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fefe1da2000
mmap(0x7fefe1dc4000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7fefe1dc4000
mmap(0x7fefe1f3c000, 319488, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19a000) = 0x7fefe1f3c000
mmap(0x7fefe1f8a000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7fefe1f8a000
mmap(0x7fefe1f90000, 13920, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fefe1f90000
close(3) = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fefe1d9f000
arch_prctl(ARCH_SET_FS, 0x7fefe1d9f740) = 0
mprotect(0x7fefe1f8a000, 16384, PROT_READ) = 0
mprotect(0x7fefe1fa4000, 4096, PROT_READ) = 0
mprotect(0x55d7d6579000, 8192, PROT_READ) = 0
mprotect(0x7fefe1ff8000, 4096, PROT_READ) = 0
munmap(0x7fefe1fa8000, 143139) = 0
brk(NULL) = 0x55d7d7a0b000
brk(0x55d7d7a2c000) = 0x55d7d7a2c000
getpid() = 3537
getcwd("/home/user/Downloads/Proot", 4096) = 27
lstat("/home/user/Downloads/Proot/001_busybox", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
getcwd("/home/user/Downloads/Proot", 4096) = 27
stat("/home/user/Downloads/Proot/001_busybox/home", 0x7ffe786a5850) = -1 ENOENT (No such file or directory)
lstat("/home/user/Downloads/Proot/001_busybox/home", 0x7ffe786a5970) = -1 ENOENT (No such file or directory)
write(2, "proot warning: ", 15proot warning: ) = 15
write(2, "can't chdir(\"/home/user/Download"..., 92can't chdir("/home/user/Downloads/Proot/./.") in the guest rootfs: No such file or directory) = 92
write(2, "\n", 1
Why proot (only 64-bit, but not on another 32-bit PC where everything works fine) is trying to change dir to the /home
to start shell after it's prooted?
Shell is specified in /bin/sh
, not relatively to current directory:
proot -0 -b /dev -b /proc -b /sys -r ./001_busybox /bin/sh
Asked by KmsDev
(1 rep)
Jul 18, 2025, 06:09 AM
Last activity: Aug 2, 2025, 12:33 PM
Last activity: Aug 2, 2025, 12:33 PM