fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.1k stars 110 forks source link

Investigate if fakechroot can be a good replacement for proot #169

Closed fsquillace closed 7 years ago

fsquillace commented 7 years ago

Many recent issues are due to obscure problems with proot. Troubleshooting such issues (like segfault on executing locale-gen) are hard.

It might be worth understand if fakechroot could be a good replacement for proot. This would imply to remove the emulation support but in any case such feature was not meant to be the highest priority for JuNest.

fakechroot is much easier to modify and understand compared to proot.

fsquillace commented 7 years ago

Different solutions have been taken into account. The main issue is that the binaries and libraries have the dynamic linker hardcoded. It is possible to patch them via PatchELF but it did not work either.

In particular, the patch for chroot and libc.so.6 worked fine but the patch for libfakechroot.so did not work:

>> patchelf --set-interpreter /home/vagrant/.junest/usr/lib64/ld-linux-x86-64.so.2 ~/.junest/usr/lib/libfakeroot/fakechroot/libfakechroot.so
cannot find section .interp

So it seems possible to run the JuNest chroot binary outside Arch Linux but it seems hard or impossible to make it working via fakechroot.

The test has been performed using vagrant on a CentOS with Kernel version 3.10