Playing Steam games using Box86 and Wine on Linux Phone

🇹🇼 中文版

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 wouln’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
1
2
sudo apt update
sudo apt install debootstrap debian-archive-keyring x11-xserver-utils dbus-x11
  1. Create gaming directory
1
2
mkdir gaming
sudo chown root:root gaming
  1. Install a chroot armhf Debian environment
1
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
1
2
3
4
5
6
7
8
9
cd gaming
sudo mount -t proc /proc proc/
sudo mount -t sysfs /sys sys/
sudo mount --bind /dev dev/
sudo mount -t devpts devpts 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
  1. Chroot into Debian
1
2
chmod + startg.sh
./startg.sh
  1. Install VIM
1
2
apt update
apt install vim
  1. Edit /root/.bashrc. Add these environment variables:
1
2
3
4
5
6
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
1
2
3
4
5
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
  1. Create a new user
1
2
3
4
adduser --home /home/ivon ivon
usermod -g users ivon
passwd ivon
passwd root
  1. Run visudo. Add the normal to sudoers
1
2
root  ALL=(ALL:ALL) ALL
ivon  ALL=(ALL:ALL) ALL
  1. Switch to normal user
1
2
su ivon
cd
  1. Edit .profile and add these:
1
2
3
4
5
6
7
8
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:
1
2
3
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:
1
2
3
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 Mobain host. Copy infmt.d of chroot to host.
1
sudo cp -r ~/gaming/etc/binfmt.d/box* /etc/binfmt.d/
  1. Restart binfmt services. Go back to chroot.
1
sudo systemctl restart systemd-binfmt

3. Install Steam and Steam Proton

  1. Install dependencies of Steam
1
2
3
4
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
1
2
3
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.
1
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

  1. Install Wine and Wine64 from Wine-tkg (a Wine fork for gaming)
1
2
3
4
5
6
cd ~/Downloads
wget https://github.com/Frogging-Family/wine-tkg-git/releases/download/5.22.r2.g0ae73155/wine-tkg-staging-fsync-git-5.22.r2.g0ae73155-309-x86_64.pkg.tar.zst
mkdir TKG-5.22/ && cd TKG-5.22/
tar -xvf ../wine-tkg-staging-fsync-git-5.22.r2.g0ae73155-309-x86_64.pkg.tar.zst
cd ~/
mv ~/Downloads/TKG-5.22/ ~/wine-tkg
  1. Add Wine path to .bashrc. When Steam is trying to run x86 games it will execute Wine first.
1
echo 'PATH=$PATH:/home/$USER/wine-tkg/usr/bin' >> ~/.bashrc

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.


Thanks for your reading. You are welcome to share articles of Ivon's Blog (ivonblog.com). Please include the original URL when reprinting or citing articles, and abide by CC BY-NC-ND 4.0 license. For commercial use, please write an e-mail to me.

written by human, not by AI

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

Leave a comment

Choose the commenting 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 some Disqus ADs on this page. You can leave a comment anonymously but you won't receive reply notifications.