Tutorial
Updated
Run x86 apps on l4t switch with box86
There are two methods for running x86 apps on the switch:
1) This tutorial uses box86 for running x86 apps in general in L4T ubuntu: This is useful for old opengl apps in general especially if they are from the early 2000s.
2) The second method uses Exagear windows emulator in switchroot Android 10. This method supports very limited range of directx games. It is however quite useful for visual novels. Go to the discord for https://www.reddit.com/r/AndroidVisualNovels. Use the "alternate method" for Exagear emulator in #faq-and-guide. I tested umineko chiru (2017- steam version) with ps3 sprites. There is lag (which should not matter much for a vn) but sound and voices works perfectly.
Box86 tutorial:
Hello everyone, if you have been in the official switchroot discord you would have noticed that @Heasterian have managed to run opengl x86 apps on l4t. This tutorial will cover what he did in the most noob-friendly way possible.
Tested games after UPDATE:
GTA Vice City: Average 15 fps, unstable, stutters when driving and fps drops when loading the map
Star Wars Battlefront II: stable 10 fps on the spawn screen, Xephyr has an issue with mouse input so could not get into the game
Worms 4 mayhem: stable 25 fps
Warcraft 3 demo: stable 27 fps
Outcome
If you follow this guide step-by-step you should be at the very least capable of running x86 apps on l4t. FPS will vary depending on what app and configurations you use (See above for tested games). For this tutorial, we will run Warcraft III demo on the switch.
Setting up schroot and box86
Source rna on armbian: https://forum.armbian.com/topic/16584-install-box86-on-arm64/
1) Open a terminal on l4t and enter the following commands one by one:
2) Create a config file for the chroot by entering the following command:
3) Copy and paste the following and replace <username> with your ubuntu username: (to save in nano press CTRL+X, Then Y, then Enter)
4) Edit the nssdatabases like so:
5) Overwrite what is already there with the following: (Use CTRL+SHIFT+6 with the cursor in the beginning of the file then use the arrow keys to move to the end of the file, then press CTRL+K to delete the selection)
6) Edit the stateoverride like so:
7) Overwrite what is already there with the following:
8) Now you can schroot with:
9) Edit the bashrc like this:
10) Add the following: (if the file is not empty, add the following at the end of the file)
11) Edit sources.list in chroot like so:
12) Overwrite what is there with:
13) Run update and upgrade like so: (enter y when prompted after apt upgrade)
14) Install some required packages like so: (enter y when prompted)
15) Clone and compile box86 like this:
16) Install wine like this:
17) Install Zenity like this:
18) Exit schroot with:
Build mesa on schroot
1) Enter schroot with:
2) Install build dependencies like this:
3) Clone mesa and build: (run these commands one by one):
4) Exit schroot:
Build virglrenderer on host
1) Open a new terminal window and run the following commands:
2) Mount host tmp to chroot like this:
3) Close the terminal window
Run a game
1) Open a terminal window and enter schroot with:
2) Open a new terminal window and enter the following commands:
3) Open a new terminal and enter the following command:
4) Download W3demo.exe from https://archive.org/details/WarcraftIiiReignOfChaosDemo
5) On the schroot terminal run: (replace path to exe with where you downloaded W3demo.exe)
UPDATE : virgl server was not using the gpu but was doing software rendering. To fix this delete the lines in nano ~/.bashrc, restart the switch then type the following lines on a terminal then run schroot in that terminal.
Note: I do not know if this is safe so proceed at your own risk. Afterwards, overclock your switch and use
1) This tutorial uses box86 for running x86 apps in general in L4T ubuntu: This is useful for old opengl apps in general especially if they are from the early 2000s.
2) The second method uses Exagear windows emulator in switchroot Android 10. This method supports very limited range of directx games. It is however quite useful for visual novels. Go to the discord for https://www.reddit.com/r/AndroidVisualNovels. Use the "alternate method" for Exagear emulator in #faq-and-guide. I tested umineko chiru (2017- steam version) with ps3 sprites. There is lag (which should not matter much for a vn) but sound and voices works perfectly.
Box86 tutorial:
Hello everyone, if you have been in the official switchroot discord you would have noticed that @Heasterian have managed to run opengl x86 apps on l4t. This tutorial will cover what he did in the most noob-friendly way possible.
Tested games after UPDATE:
GTA Vice City: Average 15 fps, unstable, stutters when driving and fps drops when loading the map
Star Wars Battlefront II: stable 10 fps on the spawn screen, Xephyr has an issue with mouse input so could not get into the game
Worms 4 mayhem: stable 25 fps
Warcraft 3 demo: stable 27 fps
Outcome
If you follow this guide step-by-step you should be at the very least capable of running x86 apps on l4t. FPS will vary depending on what app and configurations you use (See above for tested games). For this tutorial, we will run Warcraft III demo on the switch.
Setting up schroot and box86
Source rna on armbian: https://forum.armbian.com/topic/16584-install-box86-on-arm64/
1) Open a terminal on l4t and enter the following commands one by one:
Code:
sudo apt install schroot debootstrap
sudo mkdir /srv/chroot
sudo mkdir /srv/chroot/debian-armhf
sudo debootstrap --arch armhf --foreign buster /srv/chroot/debian-armhf http://debian.xtdv.net/debian
sudo chroot "/srv/chroot/debian-armhf" /debootstrap/debootstrap --second-stage
2) Create a config file for the chroot by entering the following command:
Code:
sudo nano /etc/schroot/chroot.d/debian-armhf.conf
3) Copy and paste the following and replace <username> with your ubuntu username: (to save in nano press CTRL+X, Then Y, then Enter)
Code:
[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>
4) Edit the nssdatabases like so:
Code:
sudo nano /etc/schroot/desktop/nssdatabases
5) Overwrite what is already there with the following: (Use CTRL+SHIFT+6 with the cursor in the beginning of the file then use the arrow keys to move to the end of the file, then press CTRL+K to delete the selection)
Code:
# System databases to copy into the chroot from the host system.
#
# <database name>
#passwd
shadow
#group
gshadow
services
protocols
#networks
#hosts
#user
6) Edit the stateoverride like so:
Code:
sudo nano /srv/chroot/debian-armhf/var/lib/dpkg/statoverride
7) Overwrite what is already there with the following:
Code:
root root 2755 /usr/bin/crontab
8) Now you can schroot with:
Code:
sudo schroot -c debian-armhf
9) Edit the bashrc like this:
Code:
nano ~/.bashrc
10) Add the following: (if the file is not empty, add the following at the end of the file)
Code:
export LANGUAGE="C"
export LC_ALL="C"
export DISPLAY=:1
export LIBGL_ALWAYS_SOFTWARE=1
export GALLIUM_DRIVER=virpipe
11) Edit sources.list in chroot like so:
Code:
nano /etc/apt/sources.list
12) Overwrite what is there with:
Code:
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib
13) Run update and upgrade like so: (enter y when prompted after apt upgrade)
Code:
apt update
apt upgrade
14) Install some required packages like so: (enter y when prompted)
Code:
apt install git wget cmake build-essential python3
apt install gcc-arm-linux-gnueabihf
apt install python3-setuptools
apt install sudo
15) Clone and compile box86 like this:
Code:
git clone https://github.com/ptitSeb/box86
cd box86
mkdir build; cd build; cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo; make
16) Install wine like this:
Code:
wget https://twisteros.com/wine.tgz
tar zxvf wine.tgz
17) Install Zenity like this:
Code:
apt install zenity
18) Exit schroot with:
Code:
exit
Build mesa on schroot
1) Enter schroot with:
Code:
sudo schroot -c debian-armhf
2) Install build dependencies like this:
Code:
sudo apt-get build-dep mesa
3) Clone mesa and build: (run these commands one by one):
Code:
git clone https://gitlab.freedesktop.org/mesa/mesa.git -b 20.1
cd mesa
meson build
cd build
ninja && sudo ninja install
4) Exit schroot:
Code:
exit
Build virglrenderer on host
1) Open a new terminal window and run the following commands:
Code:
sudo apt update
sudo apt upgrade
sudo apt install python3-pip
sudo pip3 install meson
Code:
sudo apt install libegl1-mesa-dev
sudo apt install libgbm-dev
sudo apt install ninja-build
sudo apt install git-all
git clone https://github.com/anholt/libepoxy
cd libepoxy
mkdir _build && cd _build
meson
ninja
sudo ninja install
Code:
git clone https://gitlab.freedesktop.org/virgl/virglrenderer.git
cd virglrenderer
git checkout c7c102ba
meson build
cd build
ninja && sudo ninja install
2) Mount host tmp to chroot like this:
Code:
sudo mount --bind /tmp /srv/chroot/debian-armhf/tmp
3) Close the terminal window
Run a game
1) Open a terminal window and enter schroot with:
Code:
sudo schroot -c debian-armhf
2) Open a new terminal window and enter the following commands:
Code:
cd virglrenderer/build/vtest
./virgl_test_server --use-glx
3) Open a new terminal and enter the following command:
Code:
sudo DISPLAY=:0 Xephyr :1
4) Download W3demo.exe from https://archive.org/details/WarcraftIiiReignOfChaosDemo
5) On the schroot terminal run: (replace path to exe with where you downloaded W3demo.exe)
Code:
sudo ~/box86/build/box86 ~/wine/bin/wine 'path to exe'
UPDATE : virgl server was not using the gpu but was doing software rendering. To fix this delete the lines in nano ~/.bashrc, restart the switch then type the following lines on a terminal then run schroot in that terminal.
Code:
export LANGUAGE="C"
export LC_ALL="C"
export DISPLAY=:1
export LIBGL_ALWAYS_SOFTWARE=1
export GALLIUM_DRIVER=virpipe
Code:
sudo jetson_clocks
Last edited by ,