Both box86 & box64 are now able to run bash. And a x86/x86_64 version of bash can also be found in the the “tests” folder of box repo.
While this is a neat feature, you could wonder what could be the use of this.
Well, the use is to be able to run shell script (like linux installer) inside a “x86” environement. Imagine you have new GOG Game and want to install the linux version on a RPi4. Let’s say Knight of Pen and Paper 1, for the sake of the example. Well, once downloaded, on RPI4 with a 64bits OS and box64 installed from sources using the COMPILE.md, you would simply do:
box64 ~/box64/tests/bash ~/Download/gog_knights_of_pen_and_paper_1_edition_126.96.36.199.sh
You may need to set the shell script as executable before, but that will basicaly let the script detect a x86_64 system and launch the setup.
On an 32bits system, you could use box86 with
box86 ~/box86/tests/bash ~/Download/gog_knights_of_pen_and_paper_1_edition_188.8.131.52.sh
That would launch the 32bits setup, like here, on a Pandora (with it’s screen to small for the setup!)
The beauty of this is that it doesn’t required the “binfmt” integration to work. Some platform, like here the Pandora, or Android/Termux or even some Docker setup, don’t support binfmt integration, and that was making some operation difficult, or even impossible, like running shell script “all-in-one” installer like this.
It’s now doable! You need to build from latest sources (and it will be available in box86 v0.2.8 and box64 v0.2.0)
PS: Many of those script redirect the stdout and friends, so it might be a good idea to disable box logs and banner. Banner is disabled automaticaly when bash is detected, but not the logs, so for box64 it would be:
BOX64_LOG=0 box64 ~/box64/tests/bash ~/Download/gog_knights_of_pen_and_paper_1_edition_184.108.40.206.sh
Nothing to do for box86, as log is disabled by default now.
EDIT2: I have just added a new env. var. to box64: BOX64_BASH, to defined where an x86_64 version of bash can be found.
So with it, you can, for example, add
Inside you bashrc, or just in a new terminal session. Then just do
Directly. Box64 will detect a shell script and will launch the x86_64 version of bash automaticaly.
The same change to box86, with BOX86_BASH also exists.