[Xiaomi Mi Pad 5] TheMagicMojoMan:
Box86/64, Wine & Steam

Disclaimer:

Please read this post completely before asking questions in the dedicated questions/answers thread.

I have used a fresh install of Ubuntu 23.10. My former system where I had installed FEX-Emu caused me problems when trying to run Steam.

My script (see below) works fine with Wine 9.4. It might fail when you try installing a different version of Wine (due to changed dependencies). Please experiment yourself. It might work but might also fail.

Known issues:

Sound does not work in Wine, yet.

There is a strange error after installing Steam: some system components were missing and after reboot I was stuck at the console.

Therefore, do not forget to do sudo apt install ubuntu-desktop before reboot!!!

This will reinstall the missing components. I will investigate the problem sometime later. Also: I did not check with KDE. Please test yourself if you use KDE.

Prerequisites:

Your /etc/apt/sources.list should look like this:

deb http://ports.ubuntu.com/ubuntu-ports mantic main universe
deb http://ports.ubuntu.com/ubuntu-ports mantic-security main universe

Better not include other packages like main-backports/multiverse/restricted for now.

You need to use a kernel that supports zram! Use one of my zram boot loaders or if you use uefi to boot your Linux image than be sure that your kernel in /boot/ supports zram. (Download here)

Install zram-config: sudo apt install zram-config

Increase zram to 8 GiB: sudo nano /usr/bin/init-zram-swapping

Change code to:

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

Restart the service and check if zram had been increased:

themojoman@mipad5:~$ sudo systemctl restart zram-config
themojoman@mipad5:~$ free
total used free shared buff/cache available
Mem: 5483424 1472648 2897620 420324 1706940 4010776
Swap: 8388604 0 8388604
themojoman@mipad5:~$ zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4 8G 4K 64B 4K 8 [SWAP]

Installation:

Please download and run my convenience install and administration script by opening a terminal and running the following commands:

wget https://raw.githubusercontent.com/TheMojoMan/Xiaomi-Nabu/main/boxWineSteam_install.sh
chmod +x boxWineSteam_install.sh
./boxWineSteam_install.sh

You will be presented with the following menu:

View attachment 6088751

Choose option 1 if you like to install everything otherwise go with options 2-4.

Close Steam login window (or be sure to exit Steam completely if you did log in) for the script to continue running.

Option 5 opens a submenu where you can change wine prefix paths or Wine / DXVK versions.

Option 6 opens a administration submenu for Wine.

(More options will be added in the coming days!)

More details and examples will be shown after the next section.

Additional actions for Wine:

Beware: Wine will sometimes need 30-60 sec to display windows. Do not think that your system crashed. Just be patient and wait.

Info: A Wine prefix is a container/bottle that contains the virtual Windows system (including drive_c where apps are installed to).

During installation of Wine a window that asks to install Wine Mono will appear. It has unreadable small fonts. First, click on the "Install" button in the lower right to install Wine Mono. Then another window appears. Change the font size to 240, click "OK". Repeat the process with the following windows (both wine32 and wine64 prefixes will be made so you have to change font size for both prefixes).

View attachment 6088754View attachment 6088757

After everything is installed you should do some additional configuration for wine. Go to option 6 (- > Wine administration) and then option 1 (Configure wine32 prefix). Wait for the window to be displayed. Now, do the following changes:

View attachment 6088770View attachment 6088758

(Add ""d3d10core" etc. in field "New override for library" or use pull down menu and then click "Add".)

You might add additional drives. Note that install from external media might fail if you do not map a Windows drive to it:

View attachment 6088759

(For example: I have mapped my big data partition to drive D and my USB harddrive to drive G).

Repeat with option 2 (Configure wine64 prefix)-

Options 3 and 4 let you run 'winetricks' which can help you install missing .dll files or complete programs. Be sure to have a look at it and try installing some stuff!

View attachment 6088761View attachment 6088772

How can I run a Linux x86/x64 program?

Open a terminal, navigate to the executable file and run ./<name_of_the_executable_file> . Box86/64 will automatically pick up programs that are compiled for x86/64.

How can I install Windows programs?

Open the wine32 or wine64 explorer shortcuts at the desktop. Wait. Now navigate to the installer file and double click it.

How can I run Windows programs?

There are multiple options:

Use the wine32 or wine64 explorer. Navigate to the executable and double click it. Wait for the program to start.

Open a terminal, navigate to the executable file and run wine <name_of_the_executable_file> or wine64 <name_of_the_executable_file>

Info: The commands wine and wine64 are shortcuts to shell scripts in /usr/local/bin.

themojoman@mipad5:~$ cat /usr/local/bin/wine
#!/bin/bash
export WINEPREFIX=/media/Data/.wine32
box86 /home/themojoman/wine/bin/wine "$@"
themojoman@mipad5:~$ cat /usr/local/bin/wine64
#!/bin/bash
export WINEPREFIX=/media/Data/.wine64
box64 /home/themojoman/wine64/bin/wine64 "$@"

(My WINEPREFIX is on my data partition.)

As you can see they will use the default wine prefixes. If you want to run a Windows program with a different prefix than do the following. Run export WINEPREFIX=<name_of_other_prefix>; ~/wine/bin/wine <name_of_windows_executable> or export WINEPREFIX=<name_of_other_prefix>; ~/wine64/bin/wine64 <name_of_windows_executable>

How to make a desktop file for my Windows programs?

Use an editor, save the file to folder ~/Desktop, file name should end in .desktop. Example: "TR5.desktop"

[Desktop Entry]
Name=Tomb Raider Legend
Exec=bash -c "cd /media/Data/.wine32/drive_c/GOG Games/Tomb Raider Legend && wine trl.exe"
Icon=/home/themojoman/Pictures/TRL.jpg
Type=Application

(Use absolute pathnames, no tilde ~!)

How can I start Steam?

Use the desktop shortcut or

open a terminal and run steam or

press Alt+F2, type steam and click OK

My windows programs are grayed out in Steam. How to fix it?

Right click on the game 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 6088765

How to change default wine prefix paths?

Go to option 5 (-> change variables) and then use options 3 and 4 to change paths and option 5 to set them. The scripts in /usr/local/bin/ will be rewritten with the new paths.

View attachment 6088775

Acknowledgements:

Special thanks to:

github.com/ptitSeb for box86 & box64!!!

The Wine team (see winehq.org for more info)!!!

The Steam team for Steam and Proton!!!

Ivon Huang for this article. I used some of the code from it. Also thanks to youtuber DroidMaster for pointing me to the article!

Recently I also found this article which helped me with some dependencies for running Steam!

Last but not least:

When you installed Steam: Do not forget to do sudo apt install ubuntu-desktop before reboot!!!