Trying to set up binfmt_misc for Box86

385 views
Skip to first unread message

Wheez

unread,
Jul 5, 2021, 5:01:22 PM7/5/21
to proo...@googlegroups.com
Hello all,

Apologies if this is a noob question. I've searched through the readme and this Google groups forum, but haven't been able to figure out how to get PRoot to use binfmt_misc to send x86 binaries to Box86.  I'm kind of new to linux and systemctl/systemd/service/termux-services.  Is this even possible since PRoot already has qemu set up to use binfmt_misc?

In other words, the last step of the Box86 setup needs `sudo systemctl restart systemd-binfmt` to be entered to get binfmt_misc to forward any x86 binaries it encounters to /usr/local/bin/box86 , but when I do that, I encounter:

user@localhost:/usr/local/bin$ sudo systemctl restart systemd-binfmt
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

I know that box86 (with wine) works on the PRoot since it runs when invoking `box86 wine wineboot` - and from seeing other users' youtube videos running x86 linux software on Termux PRoot through box86.  However, it would be much more convenient to use wine/box86 (especially with winetricks) for end-users if binfmt was on our side.

For a bit more context:
  • I'm trying to run wine with box86 on an Ubuntu-20.04 proot on Termux (on an Amazon Fire HD 10'' 2021 tablet without rooting).
  • My end-goal is to make a setup script to run some Windows ham radio software on Android without root (my setup already works on Raspberry Pi).
  • I've been working with a friend on GitHub to get everything set up in Termux for box86 via this script, so you can see our exact Termux/PRoot setup steps here if that's helpful.
Thank you all for reading all of this,
Eric

Eric Wiessner

unread,
Jul 5, 2021, 5:10:43 PM7/5/21
to PRoot
I should also say that box86's binfmt forwarding mechanism usually relies on a box86 binfmt magic/mask config file in /etc/binfmt.d/box86.conf

# /etc/binfmt.d/box86.conf
:x86:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/box86:

Sergio Mari

unread,
Mar 3, 2022, 6:51:35 AM3/3/22
to PRoot
Did you manage to do it? I am looking to do the same thing
Reply all
Reply to author
Forward
0 new messages