[Xiaomi Mi Pad 5] TheMagicMojoMan:
FEX-Emu & Steam

Disclaimer:

I am gonna show you how to install FEX-Emu and get Steam up and running in Ubuntu Linux 23.10. That way you will be able play your Linux x86/x64 or Windows Steam games. Beware: FEX-Emu starts programs very slowly e.g. ~2 min. for Steam, ~3 min. for Tomb Raider III.

This is the result of me tinkering around for one afternoon/evening to get things working. So, please acknowledge that I am by no means an expert, this is very much work in progress and it might not be the best or correct way to set things up. (I just did not find a tutorial on what to do to get Steam running after installing FEX-Emu so I started experimenting myself.)

Demonstration:

View attachment 6088583

Prerequisites:

Snap the window with this guide to the left half of the screen. Open a terminal and snap its window to the right half of the screen. (Or use two workspaces and switch between them).

Everything gets easier if you use a physical keyboard.

I use "nano" editor to manipulate configuration files. You may use a different editor of your choice but be sure that you can access system files.

Saving in "nano": Ctrl + S, exiting "nano": Ctrl + X, pasting stuff from the clipboard: Ctrl + Shift + V.

You can skip reading stuff at the end of a paragraph that is set in square brackets. These are only additional comments about how I figured stuff out or when I am unsure or see potential for improvements. Some unimportant dev talk.

1. Make your system multiarch ready

Replace /etc/apt/sources.list with the content below:

sudo rm /etc/apt/sources.list
sudo nano /etc/apt/sources.list

Paste in this, save and exit nano.

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic universe
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic multiverse
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-backports main restricted universe multiverse

deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-security main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-security universe
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ mantic-security multiverse

Add sources list for amd64 and i386 packages (you can name the file differently if you like):

sudo nano /etc/apt/sources.list.d/multiarch.list

Paste in this, save and exit nano.

deb [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic main restricted universe multiverse
#deb-src [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic main restricted universe multiverse

deb [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic-updates main restricted universe multiverse
#deb-src [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic-updates main restricted universe multiverse

deb [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic-security main restricted universe multiverse
#deb-src [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic-security main restricted universe multiverse

deb [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic-backports main restricted universe multiverse
#deb-src [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu mantic-backports main restricted universe multiverse

Finally, add amd64 and i386 architectures to our system and update system sources.

sudo dpkg --add-architecture amd64
sudo dpkg --add-architecture i386
sudo apt update

[I think it would be cleaner if the amd64 and i386 packages would be installed into the x64/x86 RootFS that FEX-Emu downlaods and not in our main system. However, chrooting into the RootFS seems to be not that easy (don't know how to do it, yet).]

2. Increase ZRAM/swap

You have to use a kernel that supports zram. See e.g. "bootloaders_zram" on my MEGA download folder.

Install zram

sudo apt install zram-config

Increase zram up to 6GB (you can try out larger values):

sudo nano /usr/bin/init-zram-swapping

Change code to:

#mem=$((totalmem / 2 * 1024))
mem=$((6144 * 1024 * 1024))

[After installing Steam my system started getting unresponsive and I had to reboot several times. Then I realized that it might be a problem of RAM and found out that FEX-Emu/Steam needs more RAM than our tablet physically has.

We have to experiment with this. We might even need bigger zram or add some disk based swap as well ...]

3. Install FEX-emu

Execute the following command in the terminal to install FEX through a PPA.

curl --silent https://raw.githubusercontent.com/FEX-Emu/FEX/main/Scripts/InstallFEX.py --output /tmp/InstallFEX.py && python3 /tmp/InstallFEX.py && rm /tmp/InstallFEX.py

This command will walk you through installing FEX through a PPA, and downloading a RootFS for use with FEX.

Answer all questions with "y / yes" especially the one asking to unpack the squashfs RootFS.

After FEX-Emu is installed you could already run x64/x86 Linux programs/games. Have a look at the output in the terminal for command.

4. Download and install Steam x64

Download the x64/x86 Steam .deb package:

cd Downloads
wget https://cdn.akamai.steamstatic.com/client/installer/steam.deb

If the link is dead (which might happen in the future) then open a browser, head over to steampowered.com, click on "Install Steam" in the top and then click on the big light blue "Install Steam" button (when you hover over it it should show the url which should end in .deb).

Install Steam:

sudo dpkg -i steam.deb

(You might have to restart at this point.) There should be a Steam icon on the desktop now that you can double click to start Steam. It will open a terminal and complain that some amd64/i386 packages are missing. After pressing RETURN it will install the missing packages. Ignore error messages about missing "glibc6.so".

If there is no icon you can alternateviley start Steam from the terminal:

FEXBash steam

It will take about 2 min. for Steam to start.

[Thats why we had to make our system multiarch capable in step 1. I think the missing packages should have already been included in the RootFS that FEX-Emu installs.]

5. Activate windows games / installing Proton

After Steam has started up you can log into your account (I had to disable this security feature where a code is sent by email to confirm that a new user logs in; might be different for you; I also cannot add my telephone number, always get an error even when I am not using Linux).

Go to your library. When you click on a Windows game installation option will be grayed out. To change this you have to right click on the game in the left column and choose "Properties...". Click on "Combatibility" on the left and toggle "Force the use of a specific Steam Play combatibility tool" on. Now you can choose which Proton version should be used.

After closing the window the install option is now active and when you click on "Install" the game and the chosen Proton version will be downloaded and installed. After installation has finished you are ready to start playing your game!

View attachment 6088582

Optional: 6. Installing latest ProtonGE

You might add the latest Proton build by using GloriousEggroll's builds. Find detailed desriptions at https://github.com/GloriousEggroll/proton-ge-custom

One way of installing it is running the following script:

sudo nano installProtonGE.sh

Paste this code:

#!/bin/bash
set -euo pipefail

# make temp working directory
mkdir /tmp/proton-ge-custom
cd /tmp/proton-ge-custom

# download tarball
curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .tar.gz)"

# download checksum
curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .sha512sum)"

# check tarball with checksum
sha512sum -c ./*.sha512sum
# if result is ok, continue

# make steam directory if it does not exist
mkdir -p ~/.steam/root/compatibilitytools.d

# extract proton tarball to steam directory
tar -xf GE-Proton*.tar.gz -C ~/.steam/root/compatibilitytools.d/
echo "All done :)"

Make the file executable and start the script:

chmod +x installProtonGE.sh
./installProtonGE.sh

Acknowledgements:

Special thanks to the teams of FEX-Emu, Valve (for Steam and Proton), GloriousEggroll (ProtonGE) and many more that made this all possible. You are heros!

HAVE FUN GAMING!!!