OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
gpu-drivers high common DISPUTE

DKMS module refuses to load under Secure Boot: 'Key was rejected by service'

omarchy-4archendeavouroscachyosmanjaronvidiadkmssecure-bootlaptopdesktop
AUDITED Audited against its sources and confirmed accurate.
AUDIT NOTE

The most version-sensitive claim is the strongest part. Arch Security wiki line 691 reads "All officially supported kernels initialize the LSM, but none of them enforce any lockdown mode", and line 711 says the kernel_lockdown(7) auto-enable-under-Secure-Boot claim "is not the behaviour of the upstream kernel, nor Arch's packaged kernels". The record paraphrases both correctly, including the taint-vs-refusal distinction. dkms verified from dell/dkms master: generate_mok is in the action regex (dkms.in:3460) and the usage line. The fallback key paths are literally mok_signing_key=/var/lib/dkms/mok.key and mok_certificate=/var/lib/dkms/mok.pub (dkms.in:1351,1356). Shim's /var/lib/shim-signed/mok/MOK.priv path is the 2b branch dkms itself prefers. mok_signing_key/mok_certificate/sign_file/$kernel_source_dir are all documented framework.conf variables in dkms.8. mokutil (extra 0.7.2) and sbctl (extra 0.18) exist, and shim-signed is AUR-only, which matches the record's framing of 2b as the unusual case. Limine CONFIG.md confirms the editor is "Unconditionally disabled when Secure Boot is active", so step 3's ordering (Secure Boot off first) is correct rather than hand-waved. The 2c caveat about Arch's stock linux not shipping certs/signing_key.pem is accurate.

RISK

Turning Secure Boot off in firmware invalidates TPM-sealed secrets. If this machine dual-boots Windows with BitLocker, or uses a TPM-sealed LUKS key (systemd-cryptenroll --tpm2-device with PCR 7), it will demand a recovery key or password on the next boot. Have that recovery key in hand before you touch the firmware setting. Enrolling a MOK requires you to complete the MokManager prompt at the very next boot. If you miss it the request expires and the module stays unloadable. dkms generate_mok overwrites /var/lib/dkms/mok.key/mok.pub if either file is missing. Regenerating invalidates any previously enrolled DKMS key, so every DKMS module must be rebuilt and the new key re-enrolled.

Symptom

You turned Secure Boot on (or enrolled keys with sbctl) and now the graphical session will not start. Loading the module by hand fails:


$ sudo modprobe nvidia
modprobe: ERROR: could not insert 'nvidia': Key was rejected by service

The journal shows one or both of:


Loading of unsigned module is rejected
nvidia: module verification failed: signature and/or required key missing - tainting kernel

Same thing happens with nvidia-open-dkms, virtualbox-host-dkms, zfs-dkms, v4l2loopback-dkms.

Cause

First, separate the two messages. module verification failed: signature and/or required key missing - tainting kernel on its own is **harmless and normal** on every Arch box that uses DKMS. The module still loads, and the kernel just marks itself tainted. Only Key was rejected by service (or Loading of unsigned module is rejected) is an actual refusal.

A refusal means the kernel is *enforcing* module signatures. That is not the Arch default. The Arch Security wiki states that all officially supported kernels initialize the lockdown LSM but **none of them enforce any lockdown mode**, and notes that the kernel_lockdown(7) claim that lockdown is auto-enabled by Secure Boot is not true of upstream or of Arch's packaged kernels. So if you are seeing a rejection, enforcement was turned on by something: module.sig_enforce=1 or lockdown=integrity in the kernel command line, linux-hardened, a shim-based boot chain, or a non-Arch kernel.

The second half of the problem is that the standard "enroll a MOK" answer does not apply to a typical Arch/Omarchy machine. MOK is a shim feature. Arch and Omarchy boot Limine/UKI via efistub with your own PK/KEK/db keys (sbctl), with no shim in the chain, so there is no MokList for mokutil to write into. Enrolling through MokManager appears to succeed and modprobe still fails.

Fix

**1. Find out whether enforcement is genuinely on.**


mokutil --sb-state                              # SecureBoot enabled/disabled
cat /sys/kernel/security/lockdown               # want: [none] integrity confidentiality
cat /sys/module/module/parameters/sig_enforce   # want: N
cat /proc/cmdline
uname -r; pacman -Q linux linux-hardened linux-lts 2>/dev/null
sudo dmesg | grep -iE 'lockdown|Key was rejected|module verification'

If lockdown reads [none] and sig_enforce is N, module signing is not your problem. Look elsewhere (a failed DKMS build, or the boot loader/kernel itself not being signed).

**2a. You put the enforcement there yourself, so take it back out.** On Omarchy 4 the command line lives in limine-entry-tool drop-ins, not in /boot/limine.conf:


grep -rn 'sig_enforce\|lockdown' /etc/limine-entry-tool.d/ /etc/default/limine /etc/kernel/cmdline 2>/dev/null
sudoedit /etc/limine-entry-tool.d/zz-local.conf   # delete the parameter
sudo limine-mkinitcpio && sudo limine-update
sudo reboot

On GRUB systems remove it from GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub and run sudo grub-mkconfig -o /boot/grub/grub.cfg.

**2b. You genuinely have a shim in the chain (dual-boot with a shim-signed distro, or you installed shim-signed).** DKMS auto-generates a signing key on first build. Enroll its certificate:


ls -l /var/lib/dkms/mok.pub || sudo dkms generate_mok
sudo mokutil --import /var/lib/dkms/mok.pub
# type a one-time password when prompted, then:
sudo reboot
# MokManager appears at boot -> Enroll MOK -> Continue -> View key -> Continue
# -> enter the one-time password -> reboot
sudo dkms autoinstall -k "$(uname -r)"
sudo modprobe nvidia

**2c. You run a custom kernel and want DKMS modules signed with its own build-time key.** Point DKMS at the kernel's certs (sign_file ships in the headers package):


# /etc/dkms/framework.conf
# $kernel_source_dir resolves to /usr/lib/modules/`uname -r`/build
mok_signing_key=$kernel_source_dir/certs/signing_key.pem
mok_certificate=$kernel_source_dir/certs/signing_key.x509

sudo dkms autoinstall -k "$(uname -r)"

This only works if your kernel package actually installs certs/signing_key.pem into the headers. Arch's stock linux does not, which is why 2c is a custom-kernel path only.

**3. Emergency escape while you sort it out:** boot once with Secure Boot disabled in firmware, or add module.sig_enforce=0 at the Limine menu (the editor is unconditionally disabled when Secure Boot is active, so this needs Secure Boot off first).

Verify

sudo modprobe nvidia && nvidia-smi succeeds. sudo dmesg | grep -i 'Key was rejected' is empty. cat /sys/kernel/security/lockdown shows [none] (or the module loads despite lockdown, meaning the signature is now trusted).

Sources

secure-boot-dkms-module-key-rejected