[Guide] Installing box86/box64 and wine on ARM64 🍷

🖱️This is just a copy from this Guide:▼

This is just a copy from https://gist.github.com/nhobson99/98d1542e542d3aa25faa3c817d3f2a67
Credits to: nhobson99
More info: https://github.com/ptitSeb/box86/discussions/691

This will be a step by step guide on exactly how to install box86 on an Acer Spin 513 equipped with a Snapdragon 7C. This guide should work for several other Snapdragon Chromebooks, though YMMV. Mediatek devices will follow a similar setup, but you will compile the Rockchip (RK3399 or similar) version instead of SD845. Now on with the show:

Step 1 - Setting up Crostini

I’ve tried this on Crouton, but unfortunately it just doesn’t seem to work on my ARM based Chromebook. If you have Crouton installed on an Intel Chromebook, it should work, but I’m not sure about AMD based Chromebooks, as their graphics drivers are different.

It’s tempting to immediately create a new Crostini container, but that’s actually not what we need here just yet. You see, box86 relies on something called binfmt-support in order to work. Inside Crostini, this means creating a “privileged” lxc container. You may want to have a separate container just for running x86 applications in; for this guide, I’ll be using one called “x86” for simplicity.

Go ahead and enable the chrome flag for allowing multiple Crostini containers if you don’t already have the option. It can be found at chrome://flags and searching Crostini. It may still be experimental on your device. Next, open up a crosh shell, as we don’t actually want to start up a VM container just yet. This is where we create our privileged container. The steps are:

  1. ctrl+alt+t or go to chrome-untrusted://crosh, and type: shell
  2. enter: vmc container termina your_container --privileged true

A new container will be created titled “x86”, and once created, you’ll probably see an error and be spat back out to the shell. Type the same command again (vmc container termina your_container --privileged true) and you should be logged in to a shell running bash in your_container. The shell prompt at this point should be <your username>@your_container. It will be the same username as your Chrome OS login. By default, there is no sudo password. If you want to set one, do so now.

Step 2 - Installing prerequisites

At this point, it should be safe to use Terminal instead of manually entering your virtual machine from crosh.

You’ll need a few packages on top of the default linux container offered by Chrome OS. Those are:

  • gcc-arm-linux-gnueabihf
  • libc6:armhf
  • binfmt-support
  • cmake
  • git

One little idiosynchrosy you may have noticed is that you’ll need access to armhf libraries for libc6. You’ll also need access to some i386 and amd64 libraries, so it’s best to enable those repositories now.

The apt upgrade is not necessary, but can be done now to ensure you’re running the latest software on your VM. Now, as mentioned before, you need to install the prerequisites:

sudo apt update
sudo dpkg --add-architecture armhf
#sudo dpkg --add-architecture i386
#sudo dpkg --add-architecture amd64
sudo apt update && sudo apt upgrade -y
sudo apt install gcc-arm-linux-gnueabihf libc6 binfmt-support cmake nano lsof gedit git cabextract neofetch -y && neofetch

This should be all the prerequisites you’ll need for now, though if you need any additional libraries or applications later in the guide, I’ll make that clear.

Step 3 - Building and installing box86 and box64

This part of the guide is actually the most straightforward, because at this point you’ve done all you needed to do to set up a multiarch environment for running x86 and x86-64 applications. Now we just follow the guide for compiling box86, utilizing the cmake build preset (known as “targets”) for Snapdragon 845 SoC’s. For box64, unfortunately the compilation seems to fail with no warning for me when having dynarec enabled, so I’ll leave it disabled for now.

Install Box86/64 - You need to adapt -DRK to your CPU Model accordingly RK3588

git clone --depth 1 https://github.com/ptitSeb/box64
git clone --depth 1 https://github.com/ptitSeb/box86
cd ~/box64; mkdir build; cd build; cmake ../ -DRK3588=1; make -j$(nproc); sudo make install
cd ~/box86; mkdir build; cd build; cmake ../ -DRK3588=1; make -j$(nproc); sudo make install; cd

There also seems to be a long-standing bug right now with binfmt-support on Debian. I have a working version of both the box86.conf and box64.conf files to put in /usr/share/binfmts/.

sudo nano /usr/share/binfmts/box86.conf

package box86
interpreter /usr/local/bin/box86
magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00
mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff

sudo nano /usr/share/binfmts/box64.conf

package box64
interpreter /usr/local/bin/box64
magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00
mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff

After copying the contents of these files into their respective directories, you can run the following commands to import them and verify that they are functioning correctly:

sudo update-binfmts --import box86.conf
sudo update-binfmts --import box64.conf
sudo update-binfmts --enable
sudo update-binfmts --display

You should see something along the lines of:

box64.conf (enabled):
     package = box64
        type = magic
      offset = 0
       magic = \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00
        mask = \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
 interpreter = /usr/local/bin/box64
    detector = 
box86.conf (enabled):
     package = box86
        type = magic
      offset = 0
       magic = \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00
        mask = \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
 interpreter = /usr/local/bin/box86
    detector = 

If not enabled then perform a sudo reboot.

Finally, we can test both box86 and box64 by installing some basic packages:

sudo apt install hello:i386 -y
# (box86 debug info, if enabled)
# Hello, World!
sudo apt remove hello:i386 -y
sudo apt install hello:amd64 -y
# (box64 debug info, again, if enabled)
# Hello, World!
sudo apt remove hello:amd64 -y

Install Repos and Steam

sudo aptitude install libc6 libx11-6 libgdk-pixbuf2.0-0 libgtk2.0-0 libstdc++6 libsdl2-2.0-0 mesa-va-drivers libsdl1.2-dev libsdl-mixer1.2 libpng16-16 libcal3d12v5 libsdl2-net-2.0-0 libopenal1 libsdl2-image-2.0-0 libvorbis-dev libcurl4 osspd pulseaudio libjpeg62 libudev1 libgl1-mesa-dev libsnappy1v5 libx11-dev libsmpeg0 libavcodec58 libavformat58 libswscale5 libmyguiengine3debian1v5 libsdl2-mixer-2.0-0 libnss3 libnm0 libdbus-glib-1-2 libudev1 libnspr4 libgudev-1.0-0 libusb-1.0-0 libappindicator1 -y #libboost-filesystem1.81.0 libboost-program-options1.81.0 libboost-iostreams1.81.0


sudo apt install wine64

when I try to create the container on my Lenovo Ideapad 3 slim, I get this error

Error: operation container_create failed: failed to create container: FAILED: failed to get alias: Alias ‘debian/buster’ doesn’t exist

Idk anything about codes so would appreciate any help

Do you mean when u try this: vmc container termina your_container --privileged true ?
Did u rename your_container by penguin?
Have you started your penguin linux before doing it? (Yes you need to otherwise Crosh wont access it / without it being booted up).

If any of this fails - always repeat the process 3 times.

Hello, when I use this command: sudo update-binfmts --enable , It returned error:

mount: /proc/sys/fs/binfmt_misc: permission denied.
       dmesg(1) may have more information after failed mount system call.
update-binfmts: warning: Couldn't mount the binfmt_misc filesystem on /proc/sys/fs/binfmt_misc.

And when I entered this direction of /proc/sys/fs/binfmt_misc , I’m suprised to find that this folder is empty. It means there’s no binfmt_misc module on my linux, should I compile it myself? If it’s right, how should I do?

My device is HP chromebook x2 11, which has an arm64 cpu. Linux version is Debian 12 and the kernel version is 6.6.13-00891-g1af58030b5c8. I had not followed all steps but skiped step 1 because I don’t want to destroy the origin chromeOS environment, I’m not able to fix it if I make everything a mess, sorry.

Any help will be appreciate, thank you.

I‘m sorry I have not read the step 1 carefully. Then I read it and followed the steps. But something unexpected still happened.

When I tried this command: vmc container termina x86 --privileged true , I got the same problem with @OmniCub. It solved by connecting to another network which can access to Google server.

But then, there’s another error: Error: operation container_createfailed: failed to create container:FAILED: failed to get alias: Alias 'debian/buster' doesn't exist. I comfirmed that my debian version is 12 and its alias is bookworm, so I add image to this command and it’s vmc container termina x86 --image debian:bookworm --privileged true.

But now it return a new error: Error: Expected <true/false> after the privileged flag.

What’s the problem? IDK.Please give me a help, thank you! :face_with_spiral_eyes:

Reviewed it, I change this command to vmc container termina x86 https://storage.googleapis.com/cros-containers debian/stretch --privileged true and it worked now!

1 Like

Thanks for the tip ! If you have a chromeOS device u can feature from borealis steam which has gpu acceleration if u cant have access to borealis you can try the steam guide ive made for the arm64. This has been a mess to deal with but overall you can always find ways to get it working.

Thank you, I don’t have the demand to play steam. Instead, I prefer play galgame on my chromebook, so I’m going to install wine.

My device is HP chromebook x2 11,which has cpu of arm64: Qualcomm Snapdragon 7c. I have done all the steps of step 1, but before it I applied step 2 on ChromeOS’s default linux container: penguin. I’m not sure HOW to go ahead because you know, I was stucked on this command: sudo update-binfmts --enable. It still show that:

mount: /proc/sys/fs/binfmt_misc: permission denied.
       dmesg(1) may have more information after failed mount system call.
update-binfmts: warning: Couldn't mount the binfmt_misc filesystem on /proc/sys/fs/binfmt_misc.

Should I do from step 2 again on the container x86?

Basically you install step 2. Then end it in sudo power off.
From there start your penguin to estabelish connection to wifi (which fails easily upon restart (on fydeOS that is) not on chromeOS) but once done then u enter crosh to that terminal with priviledges and do the sudo to check about binftm support it should show as enabled.

Now keep in mind that my findings are more explored on the steam guide (which repeats this process with more detail) and that it was tested on openfyde. So you might have to play a bit with things but its meant to work.