Skip to main content

Run Windows EXE Files on a PinePhone with Box64 on Linux

·
Categories Smartphones Linux Phones
Tags Box86 Box64 PinePhone Wine
Table of Contents

Box86/Box64 are translators designed for ARM Linux systems, allowing them to run x86 programs. Pair that with the “Wine” compatibility layer and you can run Windows EXE programs.

Box86 + Wine handles 32-bit Windows programs, while Box64 + Wine64 handles 64-bit Windows programs.

Of course, the best option would be to install Windows ARM directly… but can the PinePhone even run it? XD Box86 is well suited for single-board computers like the Raspberry Pi. Compared with Android’s Proot setups, this is at least a real Linux environment, so managing Box86 and Box64 is easier. You do not even need a separate 32-bit chroot, and the execution results are better too.

Now, with mobile Linux distributions and the PinePhone, we can do this on the PinePhone too. So yes, the PinePhone is basically a dev board with a screen.

1. Prerequisites
#

Box86 currently has to be compiled manually, and it does not support distributions that use muslC. In other words, postmarketOS cannot compile Box86.

For easier package installation, my distribution is Mobian, which is based on Debian.

2. Compile Box86 and Box64
#

Because the PinePhone is slow, compilation takes at least 30 minutes even with all threads enabled.

  1. Install the following packages.
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install git build-essential cmake wget gcc-arm-linux-gnueabihf zenity:armhf libasound*:armhf libstdc++6:armhf mesa*:armhf
  1. Compile Box86.
cd
git clone https://github.com/ptitSeb/box86
cd box86
mkdir build; cd build; cmake .. -DRPI4ARM64=1 -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j$(nproc)
sudo make install
cd
rm -rf box86
  1. Compile Box64.
cd
git clone https://github.com/ptitSeb/box64.git
cd box64
mkdir build; cd build; cmake .. -DRPI4ARM64=1 -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j$(nproc)
sudo make install
cd
rm -rf box64

3. Download Wine and Wine64
#

The precompiled Wine executables below come from the PlayOnLinux website, using the Phoenicis builds.

  1. Download 32-bit Wine.
mkdir ~/wine
cd ~/wine
wget https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-amd64/PlayOnLinux-wine-4.7-upstream-linux-amd64.tar.gz
tar -xvf *.tgz
mv wine/* ~/wine
rm -rf *.tgz wine
cd
  1. Download 64-bit Wine.
mkdir ~/wine64
cd ~/wine64
wget https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-amd64/PlayOnLinux-wine-6.17-upstream-linux-amd64.tar.gz
tar -xvf *.tar.gz
cd

4. Keep the Runtime Environments Separate
#

For easier execution, I wrote one script for each setup. Each script first declares the environment variables used by that session, then ends with the command to run. For example, box86 wine explorer opens Wine’s file manager. To run an EXE, use box86 wine .

  1. Box86 script: runwine.sh
export WINEPREFIX=~/.wine
export BOX86_PATH=~/wine/bin/
export BOX86_LD_LIBRARY_PATH=~/wine/lib/wine/i386-unix/:/lib/i386-linux-gnu:/lib/aarch64-linux-gnu/
box86 wine explorer
  1. Box64 script: runwine64.sh
export WINEPREFIX=~/.wine64
export WINEARCH=win64
export BOX64_PATH=~/wine/bin/
export BOX64_LD_LIBRARY_PATH=~/wine/lib/wine/i386-unix/:/lib/i386-linux-gnu:/lib/aarch64-linux-gnu/
box64 wine64 explorer
  1. Give the scripts execute permission.
chmod +x runwine.sh
chmod +x runwine64.sh
  1. If you need Winetricks, follow the official Box86 method and create symlinks for Wine, 32-bit only, so Winetricks thinks you really installed Wine on the system.

5. Actual App Runtime Results
#

If the desktop environment is Phosh, connect the PinePhone to a monitor, keyboard, and mouse through a Type-C hub. Phosh will enter windowed mode and operate more like desktop Linux.

In testing, desktop-ish programs like Notepad++ and Foobar2000 ran normally.

For games, though, the PinePhone only has enough performance for very old visual novels. Even Key’s AIR (2000) uses almost the entire CPU. 3D games are, naturally, comedy.

6. References
#

Related


Thank you for reading. Public comments are not available on this website. I write to explore ideas honestly, not to chase social engagement or traffic. I would be glad to hear your thoughts after reading the article with care. If you found any errors, technical issues, or would like to share feedback, feel free to contact me via the email listed on the About page.