How to Install Box86, Box64 and Wine on Raspberry Pi OS Bullseye 64-bit

Safi Ud Din Khan
5 min readMay 18, 2022

A Raspberry Pi4 is a great little single-board computer but since it’s ARM-based, it cannot run x86 and x86_64 applications. To remedy this we have the Box86 and Box64 compatibility layers which translate x86 and x86_64 Linux binaries into ARM and AARCH64. Box86 and Box64 kind of work like Apple’s Rosetta 2 and it does not completely emulate the x86 and x86_64 Linux binaries non-natively but would rather use native libraries where ever possible which gives it far greater performance than QEMU and makes many modern commercial games playable on Linux.

Box86 and Box64 can be installed with Pi-Apps and PiKISS on 32-bit versions of Raspberry Pi OS but they don’t work on 64-bit Raspberry Pi OS Bullseye.

How to Install Box64 on Raspberry Pi OS 64-bit Bullseye?

  • First install these packages on your Raspberry Pi4 OS by typing “sudo apt install build-essential mono-runtime git cmake” on your terminal.
  • Go to your homefolder by typing “cd ~” and then clone Box64 source code from github by typing “git clone https://github.com/ptitSeb/box64" on your terminal.
  • Goto the Box64 folder by typing “cd box64” on your terminal.
  • Type this on your terminal “mkdir build; cd build; cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo” and press enter.
  • Compile Box64 by typing “make -j2” on your terminal.
  • Once everything is done type this “sudo make install” and then this “sudo systemctl restart systemd-binfmt” on your terminal to install Box64.

And Box64 is installed and now you will be able to run X86_64 binaries on your Raspberry Pi 4.

How to Install Box86 on Raspberry Pi OS 64-bit Bullseye?

Installing Box86 on Raspberry Pi OS 64-bit Bullseye is bit tricky but it is not that difficult ones you figure out everything.

  • First enable multiarch if it is not by typing “sudo dpkg — add-architecture armhf” on the terminal.
  • Install these packages before compiling Box86 on 64-bit Raspberry Pi OS by typing “sudo apt install gcc-arm-linux-gnueabihf” on the terminal.
  • Go to your homefolder by typing “cd ~” and then clone Box86 source code from github by typing “git clone https://github.com/ptitSeb/box86" on your terminal.
  • Goto the Box86 folder by typing “cd box86” on your terminal.
  • Type this on your terminal “mkdir build; cd build; cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo” and press enter.
  • Compile Box86 by typing “make -j2” on your terminal.
  • Once everything is done type this “sudo make install” and then this “sudo systemctl restart systemd-binfmt” on your terminal to install Box86.

And Box86 is installed and now you will be able to run X86 binaries on your Raspberry Pi 4. Though most games wont run since 32-bit armhf libraries are missing so install these packages to ensure your games will run:

“sudo apt install libegl-mesa0:armhf libgdm1:armhf libgl1-mesa-dri:armhf libglapi-mesa:armhf libgles2-mesa:armhf libglu1-mesa:armhf libglx-mesa0:armhf mesa-va-drivers:armhf mesa-vdpau-drivers:armhf mesa-vulkan-drivers:armhf libsdl1.2debian:armhf libsdl2–2.0–0:armhf libudev1:armhf”

You can install any missing 32-bit libaries at anytime by “sudo apt install <package_name>:armhf” but do remember that do not install any other 32-bit packagers other than the missing 32-libraries otherwise the 64-bit alternate will be automatically uninstalled by apt.

How to Install Wine on Raspberry Pi OS Bullseye 64-bit?

Installing Wine on Raspberry Pi OS 64-bit Bullseye is quite tricky and the Wine from the Debian Repos will not work as you would have install X86 and x86_64 bit version of wine. I don’t know how to install wine64 but I will tell you how to install wine32 on your Raspberry Pi OS.

  • Before anything install these packages by typing “sudo apt install libasound2 libc6 libglib2.0–0 libgphoto2–6 libgphoto2-port12 libgstreamer-plugins-base1.0–0 libgstreamer1.0–0 libldap-2.4–2 libopenal1 libpcap0.8 libpulse0 libsane1 libudev1 libunwind8 libusb-1.0–0 libvkd3d1 libx11–6 libxext6 ocl-icd-libopencl1 libasound2-plugins libncurses6 libtinfo5 libasound2:armhf libc6:armhf libglib2.0–0:armhf libgphoto2–6:armhf libgphoto2-port12:armhf libgstreamer-plugins-base1.0–0:armhf libgstreamer1.0–0:armhf libldap-2.4–2:armhf libopenal1:armhf libpcap0.8:armhf libpulse0:armhf libsane1:armhf libudev1:armhf libunwind8:armhf libusb-1.0–0:armhf libvkd3d1:armhf libx11–6:armhf libxext6:armhf ocl-icd-libopencl1:armhf libasound2-plugins:armhf libncurses6:armhf libmpeg2–4:armhf libmpeg2encpp-2.1–0:armhf libtinfo6:armhf libmpg123–0:armhf libtinfo5:armhf cabextract libxslt1.1:armhf zenity” on your terminal. These are mostly missing libraries which would we required by Wine.
  • Go to home folder by typing “cd ~” on your terminal.
  • Download the Twister OS version of Wine by typing “wget https://twisteros.com/wine.tgz -O ~/wine.tgz”. Its the most easiest way. The last time I checked the Twister OS Wine version was 5.13.
  • Now uncompress the wine by typing “tar -xzvf ~/wine.tgz” on your terminal.
  • Now enter the following commands:

sudo ln -s ~/wine/bin/wine /usr/local/bin/wine
sudo ln -s ~/wine/bin/wineboot /usr/local/bin/wineboot
sudo ln -s ~/wine/bin/winecfg /usr/local/bin/winecfg
sudo ln -s ~/wine/bin/wineserver /usr/local/bin/wineserver
sudo chmod +x /usr/local/bin/wine /usr/local/bin/wineboot /usr/local/bin/winecfg /usr/local/bin/wineserver

  • Next step is to boot wine by typing “wine wineboot”
  • Now open file “~/.bashrc” in your terminal by typing “nano .bashrc” in your home folder and put this at the end of it “export BOX86_NOBANNER=1” and save the file and restart your terminal.

Now at this point everything should run properly. Do rememember its a good idea to run everything in a 800x600 virtual desktop to save yourself from graphical glitches by typing “winecfg” in your terminal and put a tick mark on “Emulate a virtual desktop”.

--

--

Safi Ud Din Khan

I write on free and open-source software, Linux and other Unix-Like operating systems, programming and history.