This month, I’m throwing in something different for a change. Some of you may have already read about it in the forums at https://forum.odroid.com/viewtopic.php?f=91&t=34070, and I want to talk about it: Box86, which is a new kind of x86 emulator for ARM running on ODROIDs.
What is Box86?
Box86 is a x86 emulator that allows you to run x86 Linux applications on your ODROID. This enables you to run programs (or probably mainly games) that were not written for ARM boards and are not open source, which is the case with most commercial software. As these games most of the time do not exist for ARM, we are normally left out playing them on SBCs like the ODROID, although the device would be capable of running them if they would exist for ARM.
Are there other solutions for running x86 software on ARM?
Yes: qemu, for example, is capable emulating an entire x86 PC, and with that gives you the capabilities to run basically everything you want. It emulates, GPU, CPU, and other devices such as LAN and USB. The issue with this solution is that it is very slow since it emulates an entire PC, and, although it works, it’s so slow that it’s nearly unusable. I already had success with Windows 2000 and XP running on qemu (proving that it can really run nearly everything), but it took forever and was very slow.
Another example would be DOSBox, which also emulates a x86 PC, although a very old 286 – 486 style which has a reduced set of instructions. This solution runs rather well, and allows you to run old DOS based programs and games, or can even be used to run Windows 3.11. Although a lot faster, it’s very limited by the old architecture that it’s supposed to run, and therefore you will be limited to old DOS games, and maybe Windows 3.11 applications.
A solution that I explored already in the past was ExaGear, which allowed running of x86 applications on ARM by emulating the CPU instructions, but not the entire PC. It is a lot faster than qemu and is able to run x86 Linux applications, including “wine” which allows you to run Windows applications under Linux.
I explored the capabilities of ExaGear in depth and wrote a couple of articles about it, as well as making a compatibility list at https://oph.mdrjr.net/meveric/other/ExaGear/, which shows quite nicely how good ExaGear performs. In fact, it’s probably the most mature software that is currently in existence that allows you to run x86 applications on ARM. Sadly, Eltechs discontinued ExaGear for ARM Desktop devices which means you can’t obtain it anymore.
What’s the difference with Box86?
Qemu is too slow to be useful and DOSBox is too limited to run modern Windows/Linux applications. But if ExaGear is that good, what is the reason for getting a new type of emulator, aside from the fact that ExaGear was discontinued?
Well ExaGear, although quite good, had one very big flaw: it was running everything in the i386 (x86) environment, which also is the case for the GPU drivers, which limited the the software only for use with applications that did not require 3D acceleration. Basically, any game that used “modern” graphics did not work, since it required OpenGL, which our ODROIDs lack the necessary drivers for and especially not for i386.
This is where Box86 can shine. Many of the libraries required for an application are redirected to the libraries from your ARM board, which means, instead of using SDL2 from i386, Box86 is able to use SDL2 from your ARM host system. This includes the GPU drivers, as well. If an application requires OpenGL to run, it will no longer ask for i386 OpenGL drivers, but instead ARM OpenGL drivers, and although ODROIDs do not have native OpenGL, thanks to @ptitSeb, we have an OpenGL to OpenGL ES wrapper called gl4es which allows us to run many many OpenGL applications. But it is not only OpenGL that is being used from the ARM system rather than the i386 system. There are many other libraries, such as SDL, OpenAL, X11 and so on, also being used from the native ARM environment rather than using everything from i386.
This also means that you need much fewer libraries from i386 than ExaGear, which required a full i386 environment. This, combined with the x86 emulation, opens up an entirely new field of applications which did not work before.
Is Box86 the holy grail for x86 on ARM?
It is possibly the holy grail for x86 on ARM and the fact that it’s open source allows the project to be developed by many people, which in time may result in a wonderful software package, indeed. Currently Box86 is not there yet. It’s a very new project and still has a long way to go. A lot of stuff is not yet supported and it still has bugs, but the beauty is that you can see changes nearly on a daily basis and the software keeps getting better and better. Furthermore, being open source, this software could become famous, very quickly and, with that, more developers may fix bugs and improve the software.
It already has some good games that it can run; some of which make good use of the OpenGL capabilities of the setup (most famously probably Neverwinter Nights) and I’m pretty sure new games will soon follow.
So what can it run right now?
The number of supported applications is still very low, and it’s a trial and error mechanism to find out if an application is supported or not. Still, there are already a few games that are working just fine on Box86. Airline Tycoon Deluxe, for example, should run full speed (https://www.gog.com/game/airline_tycoon_deluxe), which is a very interesting management game in the huge Tycoon series of game, which lots of charm and fun.
Neverwinter Nights Diamond Edition is a very deep RPG game in the Dungeon & Dragons universe. Currently, only the Enhanced Edition Pack can be bought on GoG https://www.gog.com/game/neverwinter_nights_enhanced_edition_pack. This is easily the most impressive graphical game for the system, as it uses @ptitSeb’s gl4es to convert the OpenGL graphics to OpenGL ES. It’s rather demanding, however, but should be fine in lower resolutions around 800×600 up to 720p.
Cook Serve Delicious (https://www.gog.com/game/cook_serve_delicious) is a nice time management/reaction game where you cook up the meals for your customers. Similar to Airline Tycoon Deluxe, it should run full speed even in 1080p, although it uses some OpenGL for effects, but thanks to @ptitSeb’s gl4es, it runs perfectly fine. UNDERTALE
(https://www.gog.com/game/undertale) also works well in 1080p, although there isn’t much going on in the matter of graphics. Gods Will Be Watching (https://www.gog.com/game/gods_will_be_watching) seems to work well also. It is not always full speed, but nothing to worry about.
Another impressive game is Freedom Planet (https://www.gog.com/game/freedom_planet) which feels and plays a little bit like Sonic, but with much more action. The game takes a long time to load, which currently is a the case with many applications, but once the initial loading is done, the game loads a lot faster. It suffers from some slight speed issues: intro and cutscenes are at full speed, but in game it’s a little bit slow, although still fully playable and quite impressive as well.
Another well known game is Faster than Light (https://www.gog.com/game/faster_than_light) which is working as well, but it suffers from long loading time at the start along with some sound issues. The speed is not 100%, but with this kind of game, it’s not required to have full speed. The game is nice, and I spend quite some time playing this on the ODROID. There are other games that work to certain degrees, as well, like most of the AGS (Adventure Game Studio) games (https://www.gog.com/games?devpub=wadjet_eye_games&page=1&sort=popularity) but they vary a lot in matter of game speed and performance, such as “Eschalon Books series” (https://www.gog.com/game/eschalon_book_i) which uses OpenGL in lots of places. And I wouldn’t even try it on ExaGear for that reason, although it’s also rather slow on Box86 at the moment. World of Goo (https://www.gog.com/game/world_of_goo) also seems to start but becomes too slow for me to play. DEFCON (https://www.gog.com/game/defcon) seems to work after a long period of loading, but it’s rather slow and laggy.
Inherit the Earth (https://www.gog.com/game/inherit_the_earth) seems to work fine, but it can run on ScummVM as well so that’s not a big deal. PixelJunk Shooter (https://www.gog.com/game/pixeljunk_shooter) starts, but is way too slow to play. So yes, there is already a selection of games you can run with Box86 and I’m sure there will be more to come.
What about Windows games and Wine?
ExaGear has the big advantage that it is able to run Wine under the i386 environment, which allows you to play windows games on your ODROID. This works quite nicely, as long as the games do not require 3D acceleration to run. So does Box86 offer the same? Unfortunately, no. You’re currently limited to Linux-only applications, although this may change in future, after all, wine is also “just” a Linux application.
How can you use Box86?
Here’s how you normally would use Box86:
- Visit https://github.com/ptitSeb/box86
- Download the code
- Compile it yourself
- Add a repository with the i386 libraries needed to play your games Set your environment variables as described at https://github.com/ptitSeb/box86/blob/master/USAGE.md
- If you haven’t got gl4es already repeat Steps 1-5 for gl4es as well.
- Try to get things to work.
Steps 1 to 3 can already be a hassle, and Step 4 can be complicated if you don’t know how to get these libraries, and even Step 5 can be a little bit hideous as it will often include the same commands. To make things easier, I took the liberty of preparing a .deb file for you, which hopefully handles Steps 1 to 5 already, although this is not guaranteed that it will work. It has the binary inside, as well as the most commonly used i386 libs that I could find, which is a straight copy from the libs of Debian. I also wrote a little script in front of Box86 that will include the libraries that I included in the package, as well as set include paths for the most commonly used applications that have their own libraries. Many games come with a folder lib, lib32, x86 or something similar that will house libraries they use in their programs, and the script will automatically include these paths in the search path for libraries.
This means you should be able to simply go into a folder of the game that you’d like to play (for example: /home/odroid/GOG Games/Airline Tycoon Deluxe/game/ ) and run your game from a terminal by typing “box86 ” (for example: “box86 ATDeluxe”).
Still, this will not work for all applications, and you might have to use the commands in Step 5 to add your own libraries, or folders. If you find some libraries are missing, feel free to report them to me, and I will add them to my package for convenience.
The package can be installed on my Debian based OSes from my repository with the following command:
$ apt-get install box86-odroidPlease be aware that this is only available for armhf (32bit) operating systems at the moment, so you probably won’t be able to use it on the ODROID-C2 or ODROID-N2.