🇹🇼 中文版
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.
VIDEO My desktop environent is GNOME Wayland.
Install following packages 1
2
sudo apt update
sudo apt install debootstrap debian-archive-keyring x11-xserver-utils dbus-x11
Create gaming
directory 1
2
mkdir gaming
sudo chown root:root gaming
Install a chroot armhf Debian environment 1
sudo debootstrap --arch armhf --components= main,universe sid gaming http://ftp.tw.debian.org/debian/
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
Chroot into Debian 1
2
chmod + startg.sh
./startg.sh
Install VIM 1
2
apt update
apt install vim
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
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
Create a new user 1
2
3
4
adduser --home /home/ivon ivon
usermod -g users ivon
passwd ivon
passwd root
Run visudo
. Add the normal to sudoers 1
2
root ALL =( ALL:ALL) ALL
ivon ALL =( ALL:ALL) ALL
Switch to normal user 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
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
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
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/
Restart binfmt services. Go back to chroot. 1
sudo systemctl restart systemd-binfmt
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*
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
Run Steam. This should open the game list. 1
steam +open steam://open/minigameslist
Log into your Steam account. Then enable Steam Play in Settings so it will automatically install Proton after downloading Windows games.
Pinephone users could launch Steam in “Big Picture” mode. But usb dongle does not working on my Xiaomi Poco F1.
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
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
“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.
“nacrissu” (a x86 Linux game) works.
It is also possible to run other Windows programs using wine
commands in terminal.