Running Linux version of Steam using box86 using chroot and install Wine.
Note: Box86 uses sofware multithreaded-cpu based GPU emulation.
Parts of this guide are based on this article by rna from armbian forum https://forum.armbian.com/topic/16584-install-box86-on-arm64/
We need debootstrap to create the chroot and schroot to enter the chroot.
We need to install virgl-test-server to have GPU acceleration.
Ubuntu :
sudo apt update -y
sudo apt install -y git ninja-build python3 python3-pip libgbm-dev schroot debootstrap
python3 -m pip install --upgrade meson
Fedora:
sudo dnf install --refresh -y debootstrap schroot virglrenderer-test-server xorg-x11-server-Xephyr
# Build and install libepoxy
git clone https://github.com/anholt/libepoxy
cd libepoxy; meson -Dprefix=/usr build; ninja -j$(nproc) -C build; sudo ninja -C build install; cd ../
# Build and install virglrenderer
git clone https://gitlab.freedesktop.org/virgl/virglrenderer
cd virglrenderer; meson -Dprefix=/usr build; ninja -j$(nproc) -C build; sudo ninja -C build install; cd ../
sudo mkdir -p /srv/chroot/debian-armhf
sudo nano /etc/schroot/chroot.d/debian-armhf.conf
[debian-armhf]
description=Debian Armhf chroot
aliases=debian-armhf
type=directory
directory=/srv/chroot/debian-armhf
profile=desktop
personality=linux
preserve-environment=true
root-users=<username>
users=<username>
sudo nano /etc/schroot/desktop/nssdatabases
# System databases to copy into the chroot from the host system.
#
# <database name>
#passwd
shadow
#group
gshadow
services
protocols
#networks
#hosts
#user
sudo debootstrap --include=nano,sudo,git,wget,cmake,build-essential,meson,python3,gcc,pciutils,mesa-vulkan-drivers,libglx-mesa0,libegl-mesa0,libgles2-mesa,libglapi-mesa,libgl1-mesa-glx,libegl1-mesa,libnm0,zenity,nginx,libgtk2.0-0,libdbus-glib-1-2,libxss1,libdbusmenu-gtk4,libsdl2-2.0-0,libice6,libsm6,libopenal1,libusb-1.0-0,libayatana-appindicator1,libxtst6,libunity9,xterm,ca-certificates --arch armhf --foreign testing /srv/chroot/debian-armhf http://deb.debian.org/debian
sudo chroot /srv/chroot/debian-armhf /debootstrap/debootstrap --second-stage
sudo nano /etc/schroot/desktop/fstab
# /home /home none rw,bind 0 0
And add or uncomment the following binds in the same file:
/run /run none rw,bind 0 0
/run/lock /run/lock none rw,bind 0 0
/dev/shm /dev/shm none rw,bind 0 0
/run/shm /run/shm none rw,bind 0 0
Xephyr -resizeable :2 & virgl_test_server --use-glx
Now you should be able to schroot by typing
sudo schroot -c debian-armhf
DISPLAY=
) for Xephyr (starting from :2 when using Xephyr).nano /etc/bash.bashrc
Append the following variables at the end of the file then save:
export LANGUAGE="C"
export LC_ALL="C"
export DISPLAY=:2
export LIBGL_ALWAYS_SOFTWARE=1
export GALLIUM_DRIVER=virpipe
export VERSION_ID=bookworm/sid
export STEAM_ZENITY=zenity
export STEAMOS=1
# Uncomment the following in case you want to use indirect GLX
# export __GL_ALLOW_UNOFFICIAL_PROTOCOL=1
# export __GLX_VENDOR_LIBRARY_NAME=nvidia
# export LIBGL_ALWAYS_INDIRECT=1
echo "<username> ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
useradd -u 1000 --shell /bin/bash -rmUG wheel,video,audio,render <username>
rm /var/lib/dpkg/statoverride
su - <username>
sudo apt update -y && sudo apt --fix-broken -y install && sudo apt upgrade -y
git clone https://github.com/ptitSeb/box86
cd box86; mkdir build; cd build; cmake .. -DRPI4=1; make -j$(nproc); sudo make install
exit
exit
sudo cp /srv/chroot/debian-armhf/etc/binfmt.d/box86.conf /etc/binfmt.d/box86.conf
sudo systemctl restart systemd-binfmt
Be sure that virgl-server is still running, then run :
schroot -c debian-armhf
wget http://media.steampowered.com/client/installer/steam.deb
sudo rm /var/lib/dpkg/statoverride
sudo apt install -y ./steam.deb
setarch -L linux32 steam -no-browser steam://open/minigameslist
You should be able to run steam in the chroot using the following command :
setarch -L linux32 steam -no-browser steam://open/minigameslist
Regarding Wine we recommend to use this guide:
https://github.com/ptitSeb/box86/blob/master/docs/X86WINE.md
Adding i386 arch and installing package traditional way can cause issues with native ARM64 GPU acceleration in system.
Every time you start app from this chroot you need to have Xephyr and virgl_test_server running with command from earlier. You can define Xephyr resolution with -display variable.