Skip to main content

Playing x86 Steam games on ARM Linux devices using Box86 + Wine

Smartphone Linux Phone PinePhone Wine
Table of Contents

🇹🇼 中文版

Recently, I read Raezroth’s Linux-ARM-Gaming-Chroot guide on Github. He discussed about how to install Box86 and Steam on PinePhone/Pinephone Pro, the real Linux phone.

I do own a Pinephone. However, I choose Xiaomi Poco F1 for testing. It outperforms my PinePhone and also supports running Mobian perfectly.

I had tested this on postmarketOS, it did not work. Steam wouldn’t start in chroot on postmarketOS.

Here is my video demonstration.

1. Set up chroot environment
#

My desktop environent is GNOME Wayland.

  1. Install following packages
sudo apt update
sudo apt install debootstrap debian-archive-keyring x11-xserver-utils dbus-x11
  1. Create gaming directory
mkdir gaming
sudo chown root:root gaming
  1. Install an armhf chroot Debian environment
sudo debootstrap --arch armhf --components=main,universe sid gaming http://ftp.tw.debian.org/debian/
  1. Create a script startg.sh for starting chroot environment
cd gaming
sudo mount -t proc /proc proc/
sudo mount -t sysfs /sys sys/
sudo mount --bind /dev dev/
sudo mount --bind /dev/pts/ dev/pts/
sudo mount --bind /run run/
sudo mount --bind /run/user/1000 run/user/1000
sudo mount -t tmpfs tmpfs tmp/
sudo chroot . /bin/bash

# Auto umount everything after exiting
sudo umount proc/
sudo umount sys/
sudo umount dev/
sudo umount dev/pts
sudo umount run/
sudo umount run/user/1000
sudo umount tmp/
  1. Chroot into Debian
chmod + startg.sh
./startg.sh
  1. Install VIM
apt update
apt install vim
  1. Edit /root/.bashrc. Add these environment variables:
export LC_ALL="C"
export LANGUAGE="C"
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/games:/usr/local/bin:/usr/local/sbin
export STEAMOS=1
export STEAM_RUNTIME=1

chmod 1777 /dev/shm
  1. Install packages for compling Box86
source /root/.bashrc

dpkg --add-architecture arm64

apt update

apt install sudo vim make cmake git wget gnupg libx11-dev libgl-dev libvulkan-dev libtcmalloc-minimal4 libnm0 zenity chromium alsamixergui libsdl2-dev unzip libgles-dev firefox-esr:arm64 libx11-dev:arm64 libvulkan-dev:arm64 libsdl2-dev:arm64 libgl-dev:arm64 libc6-dev:arm64 libgles-dev:arm64 libsdl2-dev zstd xz-utils
  1. Create a new user
adduser --home /home/user user
usermod -g users user
passwd user
passwd root
  1. Run visudo. Add the normal to sudoers
root  ALL=(ALL:ALL) ALL
user  ALL=(ALL:ALL) ALL
  1. Switch to normal user
su user
cd
  1. Edit .profile and add these:
export SDL_VIDEODRIVER=wayland
export WAYLAND_DISPLAY=wayland-1
export GDK_BACKEND=wayland
export XDG_SESSION_TYPE=wayland
export XDG_RUNTIME_DIR=/run/user/1000
export DISPLAY=:1
export XSOCKET=/tmp/.X11-unix/X1
export _JAVA_AWT_WM_NONREPARENTING=1

2. Install Box86 and Box64
#

  1. Install Box86 from Itai Nelken’s repository
sudo wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list
wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | sudo apt-key add -
sudo apt update && sudo apt install box86 -y
  1. Install Box64 from Ryan Fortner’s repository
sudo wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
wget -O- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/box64-debs-archive-keyring.gpg
sudo apt update && sudo apt install box64 -y
  1. Open another terminal in Mobian host. Copy infmt.d of chroot to host.
sudo cp -r ~/gaming/etc/binfmt.d/box* /etc/binfmt.d/
  1. Restart binfmt services. Go back to chroot.
sudo systemctl restart systemd-binfmt

3. Install Steam and Steam Proton
#

  1. Install dependencies of Steam
xdg-user-dirs-update --force

cd ~/Downloads
wget http://ftp.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_armhf.deb
wget http://ftp.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-7_armhf.deb
sudo apt install ./lib*
  1. Install Steam from official website
wget https://repo.steampowered.com/steam/archive/stable/steam_latest.deb
sudo apt install ./steam_latest.deb
cd
  1. Run Steam. This should open the game list.
steam +open steam://open/minigameslist
  1. Log into your Steam account. Then enable Steam Play in Settings so it will automatically install Proton after downloading Windows games.

  2. Pinephone users could launch Steam in “Big Picture” mode. But usb dongle does not working on my Xiaomi Poco F1.

4. Install Wine
#

Raezroth uses wine-tkg in his tutorial, but I use Wine-GE-Proton. Wine and Wine64 are included in it.

  1. Install Wine-GE-Proton
cd ~/Downloads
wget https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton8-26/wine-lutris-GE-Proton8-26-x86_64.tar.xz
tar -xvf wine-lutris-GE-Proton8-26-x86_64.tar.xz
mv ~/Downloads/wine-lutris-GE-Proton8-26-x86_64/* ~/wine-ge-proton
  1. Add Wine path to .profile. When Steam is trying to run x86 games it will execute Wine first.
echo 'PATH=$PATH:/home/$USER/wine-ge-proton/bin' >> ~/.profile

source ~/.profile

5. Running Steam gmaes
#

  1. “This is a game” (a x86 Windows game) works well. Since Poco F1’s usb dongles do not function, I use GNOME Remote desktop for keyboard inputs.

  2. “nacrissu” (a x86 Linux game) works.

  3. It is also possible to run other Windows programs using wine commands in terminal.

Related

Netboot: Booting postmarketOS from the Internet
Smartphone Linux Phone PostmarketOS
Run Windows exe on Android through Proot Exagear on Termux
Smartphone Termux Tutorial Termux Windows Android
[Root] Running docker container on Redmi Note 5 Pro
Smartphone Root and Custom Rom Termux Android Linux Docker

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.