[Root] Box86 + Wine in 64bit chroot on Android

๐Ÿ‡น๐Ÿ‡ผ ไธญๆ–‡็‰ˆ

Note: You need root permission to do this. For non-rooted devices please use Box86 in Termux Proot instead.

Some apps only work in 32bit wine. The best way is to run box86+wine in armhf Termux Proot. However it is possible to compile box86 in 64bit proot when multi-arch enabled (use raspberry pi 4 64’s compile options) but it will not work (bad address, I/O error) Only Box64 + Wine64 works (well there are still many bugs)

After following some tutorials, I tried again in 64bit chroot (Use Linux Deploy). Both Box86 and Box64 works. You may need different wineprefix for each of them, for example export WINEPREFIX=~/.wine64. This will create a new driectory for box64.

So you can run 32bit and 64bit app at the same time.

Here’s the guide of compiling box86 in 64 bit chroot:

  1. Enable multi-arch support in Ubuntu:
1
dpkg --add-architecture armhf
  1. Edit source list:
1
sudo vim /etc/apt/sources.list
  1. Add these:
1
2
3
4
5
6
7
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal main restricted
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal-updates main restricted
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal universe
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal-updates universe
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal multiverse
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=arm64,armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
  1. Install following packages:
1
2
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 and download wine:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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
mkdir wine
cd wine
wget https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine-7.0-rc5-upstream-linux-x86.tar.gz
tar -xvf *.tar.gz
cd
  1. Run an exe (in proot it will end up with “bad address”):
1
2
3
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 *.exe

References

box86 and box64 wine(run x86 and x64 exe on arm64 debian/ubuntu by box86 and box64)

If this article is helpful to you please consider supporting me.