Cannot install RTL8812AU in Debian/Fedora Template – missing kernel headers for Qubes kernel

Hi,

I’m trying to install the RTL8812AU driver in Qubes OS in a sys-net VM (Debian 13 / Fedora 42), but I’m running into issues due to missing kernel headers.

System information:

  • VM: sys-net, Debian 13 / Fedora 42 XFCE Template
  • Kernel in VM: 6.12.64-1.qubes.fc41.x86_64
  • uname -r in VM: 6.12.64-1.qubes.fc41.x86_64
  • ls /usr/src: no kernel-headers / kernel-devel directories
  • rpm -q kernel-devel (Fedora Template): kernel-devel-6.18.10-100.fc42.x86_64

I’ve tried installing qubes-kernel-vm-support, dkms, build-essential, gcc, make, git, but still no headers for the running kernel.

Questions:

  1. Does anyone know when or where I can get kernel headers for 6.12.64-1.qubes.fc41.x86_64 for Debian/Fedora templates in Qubes?
  2. Is the only option to switch the VM to an older kernel that has headers?
  3. Is there any alternative way to install RTL8812AU in Qubes without headers for the latest kernel?

Any help is appreciated.

I think if you want to build custom kernel modules you’ll need to switch to using in-VM kernels

This is a common pain point in Qubes OS, and the root cause is worth understanding clearly before jumping to solutions.

Why You’re Hitting This Problem

In Qubes, sys-net and other VMs use a Qubes-provided kernel (6.12.64-1.qubes.fc41) that is supplied by dom0, not by the template. This kernel is loaded from dom0’s /var/lib/qubes/vm-kernels/ and injected into the VM at boot. The template’s own kernel packages (like kernel-devel-6.18.10-100.fc42) are for a completely different kernel version and are useless for building modules against the running kernel.

Matching headers for 6.12.64-1.qubes.fc41.x86_64 need to come from the Qubes repositories, not from Fedora’s or Debian’s upstream repos.


Your Options, In Order of Practicality

Option 1: Install the matching Qubes kernel headers in dom0 (Recommended)

The headers for Qubes-provided kernels live in dom0, not in the template. In dom0:

sudo qubes-dom0-update kernel-latest-qubes-vm-devel
# or more specifically, find the matching package:
sudo qubes-dom0-update --action=search kernel-devel

Look for a package matching 6.12.64-1.qubes.fc41. Once installed in dom0 at /var/lib/qubes/vm-kernels/, you can copy the headers into your template VM. The headers will typically be at something like /usr/lib/modules/6.12.64-1.qubes.fc41.x86_64/build — that symlink needs to resolve inside the VM.

The practical steps are:

  1. In dom0, find/install kernel-6.12.64-1.qubes.fc41-devel or similar via qubes-dom0-update
  2. Copy the headers into the template: qvm-run --pass-io dom0 'tar -C /usr/src -czf - kernel-headers-...' | sudo tar -C /usr/src -xzf - (adjust path as needed)
  3. Create the symlink: ln -s /usr/src/kernels/6.12.64-1.qubes.fc41.x86_64 /lib/modules/6.12.64-1.qubes.fc41.x86_64/build

Option 2: Build in a disposable/build VM with a matching kernel, install the .ko manually

Build the driver in a separate qube that uses the same Qubes kernel version and has headers available, then copy the compiled .ko into sys-net. This avoids polluting sys-net’s template with build tools.

Option 3: Switch sys-net to use the template’s own kernel instead of the Qubes-provided one

In Qube Manager or via qvm-prefs, change sys-net’s kernel setting from the default Qubes kernel to “default” or a template-managed kernel:

qvm-prefs sys-net kernel ''   # empty = use kernel from template

Then in the Fedora 42 template, install kernel, kernel-devel, and kernel-headers matching the same version — now uname -r inside sys-net will match what’s in /usr/src/kernels/, and DKMS will work normally. The tradeoff is losing Qubes’ PV kernel optimizations, though on modern hardware with HVM this is rarely noticeable.

Option 4: Use a pre-built DKMS package or out-of-tree .ko

Some community members maintain pre-built .ko files for common Qubes kernels. Check the Qubes Community Forum — searching for RTL8812AU there often turns up threads with compiled modules or working DKMS setups specific to the current Qubes kernel.

Option 5: Use a USB qube with a different adapter (avoid the problem entirely)

If your use case allows it, a USB WiFi adapter with an in-tree kernel driver (e.g., MediaTek MT7612U / mt76 driver, or Atheros ath9k_htc) requires no out-of-tree module at all and works immediately in Qubes with zero header headaches. The RTL8812AU’s need for an out-of-tree driver is a persistent issue in any immutable/specialized kernel environment.


Direct Answers to Your Questions

Q1: Where to get headers for 6.12.64-1.qubes.fc41?
They should be available via qubes-dom0-update in dom0 as a -devel or -headers variant of that kernel package. The Qubes kernel team publishes these, but sometimes there’s a lag of days to weeks after a kernel update before headers land. Check the qubes-packages-mirror directly to confirm if the package exists yet.

Q2: Switch to an older kernel?
It works, but Option 3 above (switch to template-managed kernel) is cleaner than downgrading, since you retain full control over kernel/header versioning.

Q3: Install RTL8812AU without headers?
Not in the traditional sense — the module must be compiled. The only header-free path is finding a pre-compiled .ko binary built specifically for your exact kernel version (same version, same build config), which is risky and uncommon. The forum is your best bet for this.

The cleanest long-term solution for Qubes is Option 3 or switching to an in-tree adapter.

1 Like