Skip to main content

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

Smartphone Termux tutorial Termux

🇹🇼 中文版

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

Note2: Not all programs can be run with Box64 + Wine. Please test running your Windows program with Wine on a x86 Linux PC first to confirm that it can run normally before running it with Box64. If you encounter any problems, please report them to the developer of Box64 first.

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:
dpkg --add-architecture armhf
  1. Edit source list:
sudo vim /etc/apt/sources.list
  1. Add these:
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:
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:
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”):
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)


Leave a comment

Choose the comment system you like. Giscus for codes, Disqus for anonymous comments.

Please login to your Github account to leave a comment. You can post codes here for discussion. For images, please upload to Imgur and copy links. Your comments would be visible to everyone on Github Discussions.

This comment system is provided by Disqus, you may see forcing Disqus ADs on this page. Sometimes your comment may need to be reviewed, resulting in delayed display. Thank you for your understanding.