Walkthrough: making a proot-sandbox for sioworkers. * Use debootstrap to create a new ubuntu/debian instance * Chroot there and -> `apt-get install g++` -> Install apt-rdepends (it's in universe or multiverse or sth (not in main) - change sources.list) -> Use apt-rdepends g++ > somewhere * Walk through the generated file and indent packages you would like to skip * You can skip libc (without -dev) and get simpler libc-udeb * copy it do `deps` * ln -s UBU/var/cache/apt/archives archives * mkdir packages * generate needed packages: grep '^\w' deps | sed 's/$/_*/' | xargs -L1 find archives/ -name | while read P; do cp $P packages; done; * Put libc-udeb there if you selected it * unpack them for i in packages/*.deb; do dpkg-deb -X $i BOX/; done; * extract proot.tgz into BOX * Prune docs * Test it! -> Make some a.cpp file -> cd BOX -> run LD_LIBRARY_PATH="$PWD/usr/lib:$PWD/lib" bin/proot -r . -b ../:/tmp/ usr/bin/g++ --version LD_LIBRARY_PATH="$PWD/usr/lib:$PWD/lib" bin/proot -r . -b ../:/tmp/ usr/bin/g++ -O2 -static -lm -s /tmp/a.cpp -o /tmp/a.out -> or to check if proot and g++ links with correct libraries (notice that after proot started, paths are relative to it's chroot) LD_DEBUG=libs LD_LIBRARY_PATH="$PWD/usr/lib:$PWD/lib" bin/proot -r . -b ../:/tmp/ usr/bin/g++ -O2 -static -lm -s /tmp/a.cpp -o /tmp/a.out