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.
- Install following packages
sudo apt update
sudo apt install debootstrap debian-archive-keyring x11-xserver-utils dbus-x11
- Create
gaming
directory
mkdir gaming
sudo chown root:root gaming
- Install an armhf chroot Debian environment
sudo debootstrap --arch armhf --components=main,universe sid gaming http://ftp.tw.debian.org/debian/
- 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/
- Chroot into Debian
chmod + startg.sh
./startg.sh
- Install VIM
apt update
apt install vim
- 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
- 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
- Create a new user
adduser --home /home/user user
usermod -g users user
passwd user
passwd root
- Run
visudo
. Add the normal to sudoers
root ALL=(ALL:ALL) ALL
user ALL=(ALL:ALL) ALL
- Switch to normal user
su user
cd
- 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#
- 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
- 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
- Open another terminal in Mobian host. Copy
infmt.d
of chroot to host.
sudo cp -r ~/gaming/etc/binfmt.d/box* /etc/binfmt.d/
- Restart binfmt services. Go back to chroot.
sudo systemctl restart systemd-binfmt
3. Install Steam and Steam Proton#
- 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*
- Install Steam from official website
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.
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.
4. Install Wine#
Raezroth uses wine-tkg in his tutorial, but I use Wine-GE-Proton. Wine and Wine64 are included in it.
- 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
- 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#
“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.