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_184.108.40.206.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_220.127.116.11.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_18.104.22.168.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.
3 replies on “Running Bash with Box86 & Box64”
I did not understand this before. This is important. Thank you.
Wow, thanks so much! It’s been really hard running box86 without binfmt, but now this update solves that!
[…] also, can be usefull. Have a look at a precedent blog post for details on how to set it up here: https://box86.org/2022/09/running-bash-with-box86-box64/ . Basicaly, you can now run shell script in a pseudo x86/x86_64 environement, meaning that if the […]