Make sure you understand the experimental nature of this. Things might stop working anytime, although please let me know if that happens and I will try my best to get them working again. Most importantly, please do not bug the Asahi devs about this. This is not officially released or endorsed by the Asahi Linux project.
export DBX_CONTAINER_MANAGER=podman
distrobox create --image quay.io/fedora/fedora-toolbox:40-aarch64 --name asahi-krun
distrobox enter asahi-krun
When it's ready, your terminal prompt should look something like:
📦[teohhanhui@asahi-krun ~]$
sudo dnf copr enable slp/asahi-mesa-wip
sudo dnf config-manager --save --setopt=*.priority=5 copr:copr.fedorainfracloud.org:slp:asahi-mesa-wip
sudo dnf copr enable teohhanhui/asahi-krun
sudo dnf install mesa-dri-drivers-24.1.0~asahipre20240228
sudo dnf --best install alsa-lib alsa-plugins-pulseaudio alsa-utils dhcpcd eglinfo glmark2 glx-utils libkrun mesa-demos passt pipewire-libs pulseaudio-libs pulseaudio-utils socat sommelier virglrenderer xorg-x11-server-Xwayland --exclude pipewire --exclude pipewire-pulseaudio --exclude pulseaudio
cd ~/Downloads
git clone https://github.com/slp/krun.git
cd krun
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. ~/.cargo/env
sudo dnf group install c-development
sudo dnf install clang-devel libkrun-devel llvm-devel
cargo build --release
sudo cp target/release/krun{,-guest,-server} /usr/local/bin/
sudo chmod +x /usr/local/bin/krun{,-guest,-server}
Save the krun
file from this gist as ~/.local/bin/krun
, then chmod +x ~/.local/bin/krun
.
This will be your entry point to run anything inside krun VM.
Save the krun-guest
file from this gist as ~/.local/bin/krun-guest
, then chmod +x ~/.local/bin/krun-guest
.
We use this file to override some things while running inside the krun VM (for now).
sudo dnf copr enable teohhanhui/fex-emu
sudo dnf install fex-emu
krun FEXRootFSFetcher
Then follow the instructions:
- Choose
y
to download. - Choose
1
for Fedora 40. - Choose
1
to extract. - Choose
y
to set as default.
Save the FEXBash
file from this gist as ~/.local/bin/FEXBash
, then chmod +x ~/.local/bin/FEXBash
.
This will be your entry point to run commands in the FEX environment. Tip: Don't use FEXBash
in your shell scripts, as it
does not properly handle word splitting. Use krun FEXInterpreter
or krun FEXInterpreter sh
instead.
If you do krun myprogram
where myprogram
is an x86(-64) executable, it'll automatically get run using FEX, thanks to
binfmt_misc rules. Note: This would not work for programs like steam
which are only installed inside the FEX RootFS.
sudo dnf install patchelf
krun bash
Once you're inside the krun
VM:
cd ~/.fex-emu/RootFS/Fedora_40
unshare -pfr --user --mount --kill-child /usr/bin/bash
Your terminal prompt should become something like:
[root@han-macbook-air Fedora_40]#
Switch into the chroot:
./unbreak_chroot.sh
You should have seen Chrooting into container
message, and your terminal prompt should look something like:
bash-5.2#
dnf copr enable slp/asahi-mesa-wip
sed 's/\[\(copr:copr\.fedorainfracloud\.org:slp:asahi-mesa-wip\)\]/[\1.i386]/;s/\$basearch/i386/' /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:slp:asahi-mesa-wip.repo > /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:slp:asahi-mesa-wip.i386.repo
dnf config-manager --save --setopt=*.priority=5 copr:copr.fedorainfracloud.org:slp:asahi-mesa-wip copr:copr.fedorainfracloud.org:slp:asahi-mesa-wip.i386
dnf install mesa-dri-drivers-24.1.0~asahipre20240228
dnf remove pipewire pulseaudio
dnf --best install alsa-plugins-pulseaudio alsa-utils eglinfo glmark2 glx-utils mesa-demos mesa-libEGL-devel pulseaudio-utils --exclude pipewire --exclude pipewire-pulseaudio --exclude pulseaudio
dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf install steam --exclude pipewire --exclude pipewire-pulseaudio --exclude pulseaudio
First, exit from the chroot:
exit
(Long spam of error messages... It doesn't clean up properly, but we'll take care of that below.)
And then, exit from the unshare
:
exit
This is compulsory as the previous cleanup after exiting from chroot didn't work correctly with our setup:
./break_chroot.sh
Save the steam
file from this gist as ~/.local/bin/steam
, then chmod +x ~/.local/bin/steam
.
This will be how you run Steam.
steam
Note: If you get an error like this, just try again. It should work after a few tries.
dlmopen steamui.so failed: steamui.so: cannot open shared object file: No such file or directory
Failed to load steamui.so - dlerror(): (null)
Save the steam.desktop file from this gist as ~/.local/share/applications/steam.desktop
.
It creates an entry for Steam in your app launcher. (It will launch with the terminal, because Steam is quite slow to launch,
so you would want to know what's going on, and it might crash and restart, etc.)
Check the Steam logs in ~/.steam/root/logs
Workaround has already been added in the steam
file from this gist (~/.local/bin/steam
).
The old workaround (disabling GPU accelerated rendering) was found to be bad, as it caused the renderer process to keep crashing (also, it was just slow).
If you have previously disabled GPU accelerated rendering, you should remove this line from ~/.steam/registry.vdf
:
"GPUAccelWebViewsV3" "0"
Switch to Big Picture Mode
. (Please make sure you don't have GPU accelerated rendering disabled,
or it'd be really slow.)
Follow the steps in chroot into FEX RootFS above.
dnf install lutris --exclude ntfs-3g --exclude pipewire --exclude pipewire-pulseaudio --exclude pulseaudio
Follow the steps in Exit from FEX RootFS chroot above.
Save the lutris
file from this gist as ~/.local/bin/lutris
, then chmod +x ~/.local/bin/lutris
.
This will be how you run Lutris.
lutris
Save the net.lutris.Lutris.desktop file from this gist as ~/.local/share/applications/net.lutris.Lutris.desktop
.
It creates an entry for Lutris in your app launcher.
Personally I quite like box64
. It's good to have not 1, but 2 x86-64 emulators. More competition, more options, etc.
Follow the steps in Enter distrobox container above.
sudo dnf copr enable teohhanhui/box64
sudo dnf install box64
sudo mkdir -p /x86_64/etc/yum.repos.d
sudo cp /etc/yum.repos.d/{fedora,fedora-updates,fedora-updates-testing}.repo /x86_64/etc/yum.repos.d/
sudo dnf --installroot=/x86_64 --forcearch=x86_64 --releasever=/ install system-release
sudo dnf --installroot=/x86_64 --forcearch=x86_64 install bash
Save the box64
file from this gist as ~/.local/bin/box64
, then chmod +x ~/.local/bin/box64
.
box64 bash
Unfortunately this is broken at the moment: ptitSeb/box64#1517 (You could use a separate Fedora 39 distrobox container in the meantime...)
sudo dnf --installroot=/x86_64 --forcearch=x86_64 copr enable teohhanhui/wine
sudo dnf --installroot=/x86_64 --forcearch=x86_64 install wine
Fix up the wine symlinks in /x86_64
:
( cd /x86_64/etc/alternatives; _bindir=/x86_64/usr/bin; _libdir=/x86_64/usr/lib64; sudo ln -sf ${_bindir}/wine64 wine; sudo ln -sf ${_libdir}/wine/i386-windows/wine-d3d10_1.dll 'wine-d3d10_1(x86-32)'; sudo ln -sf ${_libdir}/wine/x86_64-windows/wine-d3d10_1.dll 'wine-d3d10_1(x86-64)'; sudo ln -sf ${_libdir}/wine/i386-windows/wine-d3d10core.dll 'wine-d3d10core(x86-32)'; sudo ln -sf ${_libdir}/wine/x86_64-windows/wine-d3d10core.dll 'wine-d3d10core(x86-64)'; sudo ln -sf ${_libdir}/wine/i386-windows/wine-d3d10.dll 'wine-d3d10(x86-32)'; sudo ln -sf ${_libdir}/wine/x86_64-windows/wine-d3d10.dll 'wine-d3d10(x86-64)'; sudo ln -sf ${_libdir}/wine/i386-windows/wine-d3d11.dll 'wine-d3d11(x86-32)'; sudo ln -sf ${_libdir}/wine/x86_64-windows/wine-d3d11.dll 'wine-d3d11(x86-64)'; sudo ln -sf ${_libdir}/wine/i386-windows/wine-d3d9.dll 'wine-d3d9(x86-32)'; sudo ln -sf ${_libdir}/wine/x86_64-windows/wine-d3d9.dll 'wine-d3d9(x86-64)'; sudo ln -sf ${_libdir}/wine/i386-windows/wine-dxgi.dll 'wine-dxgi(x86-32)'; sudo ln -sf ${_libdir}/wine/x86_64-windows/wine-dxgi.dll 'wine-dxgi(x86-64)'; sudo ln -sf ${_bindir}/wine64-preloader wine-preloader; sudo ln -sf ${_bindir}/wineserver64 wineserver; )
( cd /x86_64/usr/bin; _sysconfdir=/x86_64/etc; sudo ln -sf ${_sysconfdir}/alternatives/wine wine; sudo ln -sf ${_sysconfdir}/alternatives/wine-preloader wine-preloader; sudo ln -sf ${_sysconfdir}/alternatives/wineserver wineserver; )
cd ~/Downloads
curl -fsSLo SteamSetup.exe https://cdn.akamai.steamstatic.com/client/installer/SteamSetup.exe
box64 wine64 SteamSetup.exe
Unfortunately this is broken at the moment: ptitSeb/box64#1393, ptitSeb/box64#1449
box64 wine64 steam.exe
Unfortunately this is broken at the moment: ptitSeb/box64#487 (comment)
Having the same issue. Is there any logging or verbosity to krun?
At first ran into
asahi_dri.so
not found but noticed fedora installed the main repo's version and not the copr one.