Closed WheezyE closed 2 years ago
PRoot doesn't emulate real binfmt_misc as on LInux and it doesn't give you write access to /proc either (not saying that kernel used by Android doesn't have binfmt_support compiled in). Instead it allows to supply path to emulator binary, e.g. proot -q $PREFIX/bin/qemu-386 -r /rootfs /bin/bash
. So at max you can have only one emulator at a time.
Thank you for the info, that's good to know!
Problem description
Box86 is an x86->ARM emulator. I've had success running it on proot in the past, but I would like to use box86 and the newer box64 side-by-side. To do that, I believe the only way may be to use binfmt_misc. Proot's readme says that it implements binfmt_misc(?)
The trouble is, I can't seem to register box86 in binfmt_misc so that i386 files will be automatically passed to it. Binfmt_misc is the default mechanism for how box86 catches and emulates i386 files on arm processors. Having this feature is the only way I know of to make box86 and box64 play nicely with eachother.
Steps to reproduce
I'm using this script to set up proot-distro, a user account with sudo, box64, box86 with multi-arch, and wine inside the user account (note that I'm still working on this script and that it's still highly experimental).
When box86 or box64 are first installed, they automatically put a binmft_misc config file into
/etc/binfmt.d/
. The user is then supposed to runsudo systemctl restart systemd-binfmt
as part of initial setup to load the binfmt config file into binfmt_misc. When I try installing systemctl, logging out/in, and then runningsystemctl
though, I getNote: This is the default box86 binfmt.d config file for arm platforms (stored in
/etc/binfmt.d/
):And if I try to manually set up binfmt_misc, I also get errors: This input:
results in:
Expected behavior
I'm kind of new to binfmt_misc (and linux in general), but these steps seem to work ok on Raspberry Pi 4B and other linux arm distros. In distros where it works, a user can simply invoke a program name (like
wine
orwine64
) and the appropriate box86 or box64 emulator will be run to handle the appropriate file architecture.Additional information
I'm using a freshly-installed Termux downloaded from F-Droid: