[Update 2021 July 20: Added Winetricks]
[Update 2021 July 22: Added quality of life launcher]
If you have tried TwisterOS and had it run your games and wish to get something lighter, this topic is for you.
There is one good thing with TwisterOS: it has it all:
- RetroPie as an app
- x86 Wine
- Box86
- PiKISS
- Lutris (which I personally do not like)
- Steam
- Overclocking, governor changing and I/O scheduler changing
- Chromium browser
The drawback of the completeness is that you will eventually lose performance and will probably have to lower your claims in matter of which game you will be able to run and which game not. Also, Pi 3 users will probably experiment random freezes using TwisterOS. The guys from TwisterOS notify us that there is no real 3/3B+ support since their test machines are Pi 4's.
For Pi 3 owners (and maybe older Pi 2's) having a light setting is important to get some games playable and enjoyable.
You have two routes there:
- Debloat TwisterOS
- Start from a leaner OS (Raspberry Pi OS 32 bits or even Raspberry Pi OS 32 bits Lite + raspberry-ui-mods) and install the needed binaries (here Box86 and Wine-x86).
This post will study the second route: start from a lean OS.
Starting from the leanest: Raspberry Pi OS 32 bits Lite (optional)
- Install Raspberry Pi OS 32 bits lite from PINN
- In console mode run
sudo apt-get install raspberry-ui-mods
sudo raspi-config
--> Select in boot options graphical interface autologin
- Reboot
- This is it, you have a debloated Raspberry Pi OS 32 bits with LXDE-RPD
A stock themed Raspberry PI OS 32 bits Lite with raspberrypi-ui-mods, Dark_Olympic theme and Plane icon theme |
Installing Box86 on Raspberry Pi OS 32 bits, what to know:
- First of all, Box86 is a static emulator and will recognize your x86 binaries, and will automatically starts itself when you try to invoke a x86 executable.
- Also, static emulators are managed by systemd-binfmt, the main feature of systemd-binfmt is that there can be only one active static emulator per foreign system. Thinking QEMU? Yes, QEMU and Box86 will conflict each other on one system. Make sure you do not install QEMU static on your system because QEMU will automatically reactivate itself and prevent Box86 from working. Not taking this into account can be an important loss of time.
- Begin the operations by installing the dependencies, mainly cmake and git:
sudo apt-get install git cmake
- When installing Box86 in a lean system, you will not have an update_box86.sh script. Since it is a WIP project, it is foreseen that you will have to update it from time to time. It is important to make an update script, because you might forget some compilation setting and wonder during hours why your Box86 is not working anymore. An example of update script would be:
#/bin/bash
cd ~/
rm -rf box86
git clone https://github.com/ptitSeb/box86
cd box86
mkdir build
cd build
cmake .. -DRPI3=1
make -j1
sudo make install
sudo systemctl restart systemd-binfmt
Save this script for example in /home/pi/
This script is a little different than the one present on ptitSeb's git for 3 reasons:
- System here is Pi 3. Can be changed to Pi 4 easily
- I don't use "make -j4". Using "make -j4" uses the full power of the Raspberry Pi (all the cores) but also fills the /var/swap to the death. you might experience crashes with "make -j4" while plain "make", or explicit "make -j1" will be slower but safer.
- RelWithDebInfo is not needed, its default.
Getting Wine to run: windows programs
cd kernel
./kernel_install.sh
sudo apt-get install bzip2
Another way would be to unpack both debian package binaries gotten from WineHQ (one for wineserver, one for wine client):
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-stable_5.0.2~buster_i386.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-stable-i386_5.0.2~buster_i386.deb
unpack with
dpkg-deb --extract
wine-stable_5.0.2~buster_i386.deb
dpkg-deb --extract
wine-stable-i386_5.0.2~buster_i386.deb
The extracted binaries will be usable with Box86 and you can move them from the extracted path to the desired folder. Keep the subdirectories when doing so or you will be missing dependencies while running Wine.
Keep in mind:
- The newer the Wine version, the heavier the wineprefix will be! Sometimes it is wiser to stick on a Wine v1.5 or on a PlayOnlLnux Wine version, rather than making 4 wineprefixes with Wine 5.0.2 and bloat your device.
- Debian stretch (chroot) stops at 5.0.2. If you want to use chroot as tool, do not download newer than 5.0.2.
Once Box86 and Wine are installed, make your wineprefix
WINEPREFIX=/home/pi/wineprefixes/wine-1/ /home/pi/winex86/bin/wine winecfg
- Say "no" to "mono" and especially "gecko" because these will in a first time be useless and eat your disk space (something like 500 MB).
- Start your game:
WINEPREFIX=/home/pi/wineprefixes/wine-1/ /home/pi/winex86/bin/wine /path/to/your-game.exe
Making a x86 wineprefix is KEY to avoid most worries playing x86 game, it can give you a week banging your head in the wall trying to run x86 games with an ARM wineprefix.... so beware!
GL4ES (optional)
- Check GL4ES instructions to get gl4es working. It must be done at least one time, the updates on this interpreter are less frequent than on Box86.
- Once cloned and compiled, it doesnt "make install". Instead you will have to write shell scripts like this following:
LD_LIBRARY_PATH=/home/pi/gl4es/lib/ /path/to/your/executable
- GL4ES can be used on native runnables, example: VCMI.
PiKISS
Winetricks
- Set WINEPREFIX and WINE environment variables to point to your wineprefix and your Wine binary
- Disabling Box86 banner since it crashes Winetricks.
cd ~git clone https://github.com/Winetricks/winetrickscd winetrickssudo make install
WINEPREFIX=/home/pi/wineprefixes/wine-1/ WINE=/home/pi/winex86/bin/wine BOX86_NOBANNER=1 winetricks allfonts
A /home/pi/ directory with all the hot stuff installed: Box86, GL4ES (here in subdirectory sc), PiKISS, mesa, Wine, netsurf ultra light browser and winetricks. |
[Updated 2021 July 22]
Quality of Life: starter script
WINEPREFIX=/home/pi/wineprefixes/wine-1/ /home/pi/winex86/bin/wine /path/to/someexec.exe
nano /home/pi/winex86.sh
BOX86_NOBANNER=1 WINEPREFIX=/home/pi/wineprefixes/wine-1/ /home/pi/winex86/bin/wine "$*"
chmod 755 /home/pi/winex86.sh
nano /home/pi/.bashrc
export PATH=$PATH:/home/pi/
source .bashrc
winex86.sh /path/to/x86/exe.exe
More soft performance gain?
TL/DR:
- Install Raspberry Pi OS 32 bits (or Lite + sudo apt-get install raspberry-ui-mods)
- Pi 3B+: Install vercingetorix
- Make sure you do not have QEMU installed
sudo apt-get install git cmake make
- Install GL4ES, instructions here.(optional)
- Install box86, instructions here; make sure you use make -j1 and not make -j4
- Download and unzip to /home/pi/winex86/ bzip2 PlayOnlLnux wine binaries from this website.
WINEPREFIX=/home/pi/wineprefixes/wine-1/ /home/pi/winex86/bin/wine winecfg
- Install PiKISS and get some games running with it. Make sure not to full-upgrade a Raspberry Pi 3 from PiKISS
- If you installed GL4ES, start your programs with prefix
LD_LIBRARY_PATH=/home/pi/gl4es/lib/ (...command...)
- Get and
sudo make install
Winetricks withgit clone https://github.com/Winetricks/winetricks
- Execute Winetricks with
WINEPREFIX=/home/pi/wineprefixes/wine-1/ WINE=/home/pi/winex86/bin/wine BOX86_NOBANNER=1 winetricks allfonts
- All set!
No comments:
Post a Comment