Using Box86 on the Pyra


ptitSeb

Serial Porter
Joined
Aug 15, 2012
Messages
9,306
Age
51
Location
France, near Lyon
I wanted to remind the happy owners of a Pyra that they can use box86.

There is no package so you need to build from sources, but it's very easy to do!

I'll give a short guide to get the source in the home folder and make/installa working build of box86, and then a few example of what you can run with it.

First, update your system and install the minium required to build box:
Code:
sudo apt udpate
sudo apt install -y sudo apt install build-essential git cmake cmake-curses-gui
now that you have everything to build, box, get the sources
Code:
cd
git clone https://github.com/ptitSeb/box86
cd box86

And build, using the "docs/COMPILATION.md" information:
Code:
mkdir build; cd build; cmake .. -DPYRA=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo; make
This will take a while, box86 is now quite big...
but it will finish with a 100% built message :)
Now install it
Code:
sudo make install
It's now part of the system.
Do
Code:
sudo systemctl restart systemd-binfmt
And your Pyra is now able to run x86 program in a transparent way.
If you want, you can run the tests included in box86 to ensure it's ok
Code:
ctests
But it's not mandatory.

To update box86 (because it's a project that still evolve very often), simply, first update the sources:
Code:
cd ~/box86/build
git pull
then, if something changed, just recompile and install (it should be much quicker then the 1st time)
Code:
make && sudo make install

Now, for those of you that don't want to compile stuff, Box86 is in the pyra apt repo, so you can simply use
Code:
sudo apt install box86-pyra
To have Box86 installed. But because box86 is evolving rapidely, this version may not be the latest one. So it's up to you if you want the compile-way or the easy-apt-way.


You can now launch install script, and x86 program. When launching game, don't forget the "gl4es" wrapper. So for undertale for example, use
Code:
gl4es ./UNDERTALE
in the UNDERTALE folder.

Screenshot at 2021-10-25 16-13-53.png


We'll talk about wine at a later time. Try some linux stuff first :)
 
Last edited:
Good work..thank you.
Unfortunaly i rarely used my Pyra for now.
Some Things changed in my private Life.

Maybe i will make a fresh Reinstall of the Pyra OS and will try your good explained Howto.

btw..somehow i got Netflix and DisneyPlus working on the Pyra with my last experiments..but i forgot how i did do that.

Box86 is a great Piece of Software and maybe we get many more X86 Linux and Windows Games working.

Thank you for your Effort ;)

P.S...how about a simple Bash Script for downloading,compiling and installing Box86 and Gl4es together?
Maybe it will be a little bit more easy to install it and update it for us all.
 
Great work, i will have a look as far as i get a bit more of time, next monday is a free day in germany if i remember correctly ^^
So i have just to copy the Script in my Terminal, and then i could use X86 Linux stuff as long as its dosnt need that much power? Cool ^^
@ingoreis i was wondering why there wasnt that much Pyra Video from you, now i have the Answer ^^
 
I saw Box86 on the apt repo, but haven’t been able to run anything with it. Guess I should follow this instead for a more up-to-date version? Either way, this is a fantastic tool!
 
Last edited:
When i build the BOX86, i think i should read in the Thread to find out how to run X86 Stuff..
Allthough i cant imagine any Linux X86 Software i would need there isnt allready on the ARM Debian Repo, so could be this isnt in my next video...
 
I have updated the 1st post with "how to upgrade" the source and update the build, and also, the "easy" way (using apt) for those allergic to compilation.

Now, box86 is use to run x86 software. The main target is game, as most software used on linux are opensource and so can be found directly in apt.

Some examples of the x86 linux games you should be able to run on the Pyra, using gl4es and box86: SuperMeatBoy, WorldOfGoo,FTL, GrimFandago Remake, DotT Remake, UNDERTALE, RiskOfRain,Cook Serve Delicious, Momodora, Unreal, UT99, UT2003/2004 (not completly sure), Don"t Starve, Toki Tori, Toki Tori 2, INK, limbo, Knytt Underground, some older unity3D games also, like Colin McRae, Knight of pen and paper...
 
For those who only have a Pandora, it works as well. You just have to use the CodeBlocks PND to compile it (and the libGL) and have to play with command line options to run things.
 
I dont even know how to install and run software on Linux other than the stuff from the Package Manager who shows up in the GUI, so i have still to learn alot, ..
 
I dont even know how to install and run software on Linux other than the stuff from the Package Manager who shows up in the GUI, so i have still to learn alot, ..
Do you have games on GOG, HumbleBundle or itch.io?
If you don't, box86 will probably be useless for you, there are very few free linux game that are not opensource (I can think of Locomalito stuff only, there might be a few other).
 
I have GOG, since the time when got the GPD WIN, so i have some games, even Stardew Valley , and the free stuff you get..
But the discussion how to use Software that isnt from the Package Manager might be better in a Different Thread ^^, i can remember i made a Linux Noob Thread long ago..
 
To run x86 software using box86 on a pyra or other arm based linux device, having built box86 using the instructions it should be in your path, which makes it easier to run.

First discover how you're expected to launch the program you're trying to run. Normally in the root of the game or what have you there's a shell script called launch.sh or runme.sh or something like that.

Then, open a terminal if you haven't already, cd to the game directory and type:
Code:
box86 launch.sh
(replacing launch.sh with whatever the program actually uses)

And that should be it. The program should start both in the terminal and often it'll open a graphical window for the gameplay.
 
So it would be an good idea to have these in an TXT File for every game, so maybe
Code:
box86 stardewvallyrun.sh
So I just have to copy these in my terminal

edit: I only have Stardew Valley as a game which might work on GOG, the other stuff is only Windows,
 
Last edited:
So it would be an good idea to have these in an TXT File for every game, so maybe
Or make that text file executable (no idea how to do that graphically, but in the terminal it's just 'chmod u+x launchscript') and it becomes a shell script you can run to launch a game. Then you just need to be in the right directory and type './' then a few letters and hit tab to autocomplete the line, then hit enter and the program should start. By convention shell scripts don't have the .txt extenstion though, they either don't have an extension at all or have a .sh extension, because in the linux terminal the file extension only affects the colours if you use a coloured ls, and doesn't affect whether you can run it or what happens when you run it. You can only run things that are executable, and if the file needs a special tool to execute it the convetion is to write the magic characters '#!' then the name of the interpreter or what have you. But binary executables and shell scripts are a special case that don't need magic characters to tell bash what to do with them. But as an example, most of my python files begin:
Code:
#!/usr/bin/env python3
 
I only have stardew valley on my steam account (well, it's from HB, but it's Steam-only, no drm-free version).
I'll check the precise way to run it with box86. Note that this one is a XNA game and could run with the XNA trick, but it's more complex to setup.

Also, once box86 is installed on the Pyra, with the magic of binfmt, you can forget it. It will be called automatically.
So just use `./launch.sh`, no need to prefix with box86.
But don't forget to preifx with `gl4es`
Code:
gl4es ./StardewValley.bin
might work.
 
Last edited:
Thanks, but you don’t have to make that much trouble just for me, also I should use the game as a way to learn more about how to run stuff on Linux ..
i think Sunday will be the day I try to get it to run ..
would be cool, although I have it also on Switch
 
Not yet , lots of Snowrunner, GTA Trilogie etc ditnt let me time left to learn about running stuff on Linux .. shure the software is cool, but I don’t know if it is that useful for me anyway, as the only software I would have that is also Linux where Stardew Valley and have it also on Switch
 
Back
Top