Fortnite on Linux (Fedora + NVIDIA, CachyOS)

Download script.sh Full version

One script that makes NVIDIA work with Secure Boot on Fedora, so Fortnite's anti-cheat lets you in.

You need

CachyOS? Same commands. The script runs CachyOS's own setup (eac-setup), any GPU. To play: sudo eac-setup boot. Details

Other distros? Not supported, see Other distros.

AMD or Intel GPU? Do not run the script. Turn on Secure Boot, TPM and IOMMU in BIOS, then run this and reboot (details):

sudo grubby --update-kernel=ALL --args="sysctl.kernel.kexec_load_disabled=1"

Do this

1. Download and run

curl -fLO https://deandark.me/FortniteOnLinux/script.sh
chmod +x script.sh
sudo ./script.sh

2. Reboot. A blue screen appears (only once, so stay there):

Enroll MOK → Continue → Yes → password universalblue → Reboot

3. Run it again

sudo ./script.sh

Asked to remove the current NVIDIA drivers? Type y.

Wait for Update finished!, then reboot. Done.

Later: nothing. It updates Fedora, the kernel and the driver by itself once a day. When you get "NVIDIA driver updated", reboot before playing. GNOME Software and dnf upgrade are safe to use.

Undo: sudo ./script.sh --restore brings back the RPM Fusion driver.

Fortnite says "does not recognize a Machine Owner Key"

You have an extra key. The script prints its name: Warning: other Machine Owner Keys are enrolled: ...

cd /tmp && mokutil --export
for f in MOK-*.der; do echo "$f: $(openssl x509 -inform der -in "$f" -noout -subject)"; done

Find the file with that name (not fedoraca, not ublue kernel) and delete it:

sudo mokutil --delete /tmp/MOK-0002.der

Set any password → reboot → Delete MOK → Continue → Yes → password → Reboot.

Something went wrong

Message Fix
Secure Boot is disabled. Turn it on in BIOS.
has not built the driver for kernel ... yet Wait a day or two, run again.
wrong checksum sudo rm /etc/pki/ublue/public_key.der, run again.
Update did not finish. Safe to reboot, the old kernel is still the default. Read the error above it.

What it changes

Removes the RPM Fusion NVIDIA driver and installs the signed one from Universal Blue (the Bazzite people) plus the matching Fedora kernel, and updates the rest of Fedora. Never reboots by itself.

Credits

Original script by AmilieFOSS, sincerest thanks. I tuned it up: auto key enrollment, one-step driver swap, one confirmation, anti-cheat key warnings.

Unofficial. Not made by Fedora, Universal Blue, NVIDIA or Epic.

NVIDIA drivers for Fedora with Secure Boot (Universal Blue)

Download script.sh Short version

script.sh replaces the NVIDIA driver on Fedora with the prebuilt, signed driver from Universal Blue (the project behind Bazzite, Bluefin and Aurora), and installs the Fedora kernel that driver was built for.

Why you might want this:

Contents

Requirements

What the script changes

It never reboots the computer by itself.

How to use it

1. Download and make it executable

curl -fLO https://deandark.me/FortniteOnLinux/script.sh
chmod +x script.sh

2. First run: enroll the key

sudo ./script.sh

On the first run the script downloads the Universal Blue key, checks its checksum and requests enrollment, then stops with a message like:

Universal Blue key enrollment requested. Reboot now. ...

3. Reboot and confirm the key

Reboot. Before Fedora starts, a blue screen called MOK Manager appears. It shows up only once, so do not walk away.

  1. Press a key to start, then choose Enroll MOK.
  2. Choose Continue, then Yes.
  3. Type the password: universalblue The keyboard is a US QWERTY layout on this screen, and nothing shows while you type.
  4. Choose Reboot.

If you missed the screen, run sudo ./script.sh again. It tells you the key is still waiting, and the screen appears on the next reboot.

You can check the result after booting:

mokutil --test-key /etc/pki/ublue/public_key.der

It should say ... is already enrolled.

4. Second run: install the driver

sudo ./script.sh

If RPM Fusion's NVIDIA driver is installed, the script lists its packages and asks Remove the current NVIDIA drivers and switch to Universal Blue? [y/N]. Type y. After that it runs without questions, downloads about 800 MB, installs everything and ends with:

Update finished! Kernel: ..., NVIDIA: ...

Do not reboot before you see that line. Then reboot and check:

nvidia-smi

Updating later

Nothing to do: updates are automatic. After the first successful run the script installs itself as /usr/local/sbin/fortnite-on-linux with a daily timer. Once a day (on AC power, in the background, with low priority) it updates Fedora, then moves to the newest kernel Universal Blue has built the NVIDIA driver for. When the driver changes, a notification asks you to reboot: until then, new games and apps using the GPU may fail to start.

It also tells DNF to take Fedora kernels only through the script (a file in /etc/dnf/repos.override.d/), so GNOME Software and dnf upgrade are safe to use and never install a kernel without the NVIDIA driver.

To update right now:

sudo /usr/local/sbin/fortnite-on-linux

Check the last automatic run:

journalctl -u fortnite-on-linux-update -n 30

The script does not update itself. To get a newer version, download it again and run it once.

Fortnite and Easy Anti-Cheat

Easy Anti-Cheat for Linux v2 accepts only well-known keys. Epic's list includes the Fedora and Universal Blue keys, so this setup works. It also has other requirements. Check them with these commands:

Requirement Command Expected
Secure Boot mokutil --sb-state SecureBoot enabled
TPM 2.0 cat /sys/class/tpm/tpm0/tpm_version_major 2
Kernel lockdown cat /sys/kernel/security/lockdown [integrity] selected
kexec disabled cat /proc/sys/kernel/kexec_load_disabled 1
IOMMU on, no passthrough journalctl -k -b | grep 'iommu: Default domain' Translated
BPF LSM cat /sys/kernel/security/lsm contains bpf

If lockdown, kexec or IOMMU do not match, add the boot options and reboot:

# Intel CPU
sudo grubby --update-kernel=ALL --args="lockdown=integrity iommu.passthrough=0 intel_iommu=on sysctl.kernel.kexec_load_disabled=1"
# AMD CPU
sudo grubby --update-kernel=ALL --args="lockdown=integrity iommu.passthrough=0 sysctl.kernel.kexec_load_disabled=1"

TPM 2.0 and IOMMU (VT-d on Intel, AMD-Vi or SVM on AMD) may also need to be turned on in the BIOS.

"This game does not recognize a Machine Owner Key (MOK)"

Every enrolled MOK must be well-known, so leftover keys block the game. Typical leftovers: the RPM Fusion akmods key (named after your computer), Ventoy, VirtualBox or a DKMS key. The script warns about them:

Warning: other Machine Owner Keys are enrolled: kronos_1785354888_5de559e1

To remove one:

cd /tmp && mokutil --export
for f in MOK-*.der; do echo "$f: $(openssl x509 -inform der -in "$f" -noout -subject)"; done

Find the file whose CN= matches the key from the warning (never the ones with CN=fedoraca or CN=ublue kernel), then:

sudo mokutil --delete /tmp/MOK-0002.der

Use your file's number instead of 0002. Pick any one-time password, reboot, choose Delete MOK, Continue, Yes, type the password and choose Reboot.

Removing a key stops the modules it signed from loading. If you later install something that builds its own kernel module (VirtualBox, OpenRazer, any DKMS package) and enroll its key, games with Easy Anti-Cheat stop working again.

AMD or Intel GPU

Do not run the script. It is only for NVIDIA cards and stops with No NVIDIA GPU found. on other GPUs. AMD and Intel drivers are part of the Fedora kernel and already signed by Fedora, so no extra key is needed.

Fortnite still needs the Easy Anti-Cheat requirements above. On a default Fedora with Secure Boot on, kernel lockdown and the BPF LSM are already active. Usually left to do:

  1. In the BIOS/UEFI: turn on Secure Boot, TPM 2.0 (fTPM on AMD, PTT on Intel) and IOMMU (AMD-Vi on AMD, VT-d on Intel).

  2. Disable kexec, then reboot:

    sudo grubby --update-kernel=ALL --args="sysctl.kernel.kexec_load_disabled=1"
    
  3. Check everything with the table in the section above.

CachyOS

CachyOS has official Easy Anti-Cheat support: a kernel signed by CachyOS (linux-cachyos-eac) with prebuilt NVIDIA modules, and the eac-setup tool. On CachyOS the script updates the system and runs eac-setup, nothing else. AMD, Intel and NVIDIA (GTX 750 and newer) are all supported.

curl -fLO https://deandark.me/FortniteOnLinux/script.sh
chmod +x script.sh
sudo ./script.sh

Things to know before you start, from the CachyOS guide:

The automatic updates and --restore are Fedora only. CachyOS updates the EAC kernel with the normal sudo pacman -Syu.

Other distros

The script supports only Fedora and CachyOS and stops on anything else. Easy Anti-Cheat needs a kernel signed with a key Epic knows, so the distro has to provide it:

Distro Fortnite
Bazzite, Bluefin, Aurora Works out of the box, NVIDIA included.
Ubuntu, Linux Mint Kernel key is on Epic's list, Epic tested Ubuntu. NVIDIA: use the signed driver from sudo ubuntu-drivers install, not DKMS. Not tested by me.
Debian Kernel key is on Epic's list. NVIDIA from Debian is built with DKMS, which Easy Anti-Cheat rejects.
openSUSE Kernel key is on Epic's list. Not tested by me.
Arch and other Arch-based distros Not supported: no signed kernel with a key Epic knows. Use CachyOS.

CachyOS kernel on Fedora or other distros: ports that build linux-cachyos themselves (COPR, PPA, Nix and others) are not signed with a key Epic knows, so they cannot pass Easy Anti-Cheat. What works is CachyOS's own prebuilt, CachyOS-signed linux-cachyos-eac binary, booted through CachyOS's signed systemd-boot with the CachyOS EAC CA enrolled in Secure Boot. CachyOS officially supports this only on CachyOS. Community repackages exist, for example for NixOS (nix-cachyos-kernel-eac, experimental by its own description).

Error messages

Message What to do
Please run this script with sudo. Run sudo ./script.sh.
No NVIDIA GPU found. You do not need this script, see AMD or Intel GPU.
Only Fedora and CachyOS are supported See Other distros.
Secure Boot is disabled. Turn on Secure Boot in the BIOS/UEFI.
... has the wrong checksum, delete it and run again. sudo rm /etc/pki/ublue/public_key.der, then run again.
An update is already running. Wait for the other run to finish.
Universal Blue has not built the driver for kernel ... yet. Your kernel is newer than the driver build. Wait a day or two and run again.
Expected five NVIDIA modules. or Unexpected module signer. The download looks wrong. Nothing was installed. Try again later.
Canceled, nothing was changed. You answered no (or ran it without a terminal). Run again and type y.
Needs an answer, run it by hand or run by hand (automatic update) Run sudo /usr/local/sbin/fortnite-on-linux once and answer.
The RPM Fusion NVIDIA module did not build (--restore) Do not reboot. Read the build log in /var/cache/akmods/nvidia/.
The RPM Fusion nonfree repository is not enabled (--restore) Enable it, see rpmfusion.org.
Update did not finish. Check the drivers before rebooting. The install failed. The old kernel was set as the default again, so a reboot is safe. Read the DNF error above it.

Going back to RPM Fusion

sudo ./script.sh --restore

It lists the packages, asks for confirmation, turns off the automatic updates and the kernel lock, removes the Universal Blue driver, installs akmod-nvidia from RPM Fusion and builds the module for your default kernel. Wait for Back on the RPM Fusion NVIDIA driver. before rebooting.

If the RPM Fusion signing key is not enrolled, it requests the enrollment. Reboot and on the blue MOK Manager screen choose Enroll MOK, Continue, Yes, type rpmfusion and choose Reboot.

The RPM Fusion key blocks games with Easy Anti-Cheat. The Universal Blue key stays enrolled, it is harmless. The RPM Fusion nonfree repository must be enabled (how).

Credits

The original script was written by AmilieFOSS. My sincerest thanks for it. This version builds on it: it enrolls the key by itself, replaces the RPM Fusion driver in one step after one confirmation and warns about MOKs that block Easy Anti-Cheat.

Disclaimer

This is an unofficial script. It is not made or supported by Fedora, Universal Blue, NVIDIA or Epic Games. Read it before running it as root.