Q: Maintainably installing ZFS packages into a Fedora VM (not dom0)

  • Template: fedora-34
  • Class: StandaloneVM
  • VM kernel: 5.10.76-1.fc32.qubes.x86_64 (default PVM)
  • kernel-headers: 5.14.9-200.fc34.x86_64
  • kernel-devel: 5.14.17-201.fc34.x86_64
  • ZFS: 2.1.1-1
  • Pool: (Physical drives mapped to VM)

Following conventional ZFS Fedora install instructions or using a longterm kernel hasn’t worked so far.

ERROR: could not insert 'zfs': Invalid argument ← This makes me highly-suspicious of a kABI mismatch in the DKMS-compiled kmods because it was built against kernel-devel and kernel-headers versions that aren’t close enough to the VM’s fedora-34 default kernel at /lib/modules/$(uname -r).

As a hackaround that didn’t make it to my notes (Murphy’s Law), I installed headers and devel in a VM from 5.11 that was close enough to 5.10 to “work.” I don’t trust that.

I’m open to suggestions, as detailed as possible, to making this to work reliably should kernels get swapped. Ultimately, I’m scripting the creation of this VM for cfg mgmt reasons. What I have so far is trivial from the Fedora install instructions above.

Mainly, I’d like to know: which repo and under what names are the headers for the fedora 32 qubes kernel RPMs? I’m guessing I’ll need to re-run dkms autoinstall ... with the the path to more appropriate kernel headers.

You could try to use the template kernel instead of the one provided by Qubes and dom0. I’m assuming that you are installing ZFS in the template. Approximate steps:

  1. Clone the template to fedora-34-zfs.
  2. Make sure grub2-xen-pvh is installed in dom0.
  3. Set the kernel in fedora-34-zfs to pvgrub2-pvh. In dom0, run qvm-prefs fedora-34-zfs kernel pvgrub2-pvh
  4. Now when you start fedora-34-zfs, it should use the kernel from the template, not from dom0.
  5. Make sure the kernel in each VM that uses this template is also set to the same thing.

I don’t know potential security implications of this.

Additional links:

2 Likes

I should’ve mentioned not switching from PV to HVM because performance is critical. Dom0 ZFS is also a nonstarter.

Never mind. I misread PVH as HVM. Switching kernels and throwing security up in the air isn’t what I was looking for.

Edit: As a workaround, I’m okay with dkms autoinstall ... now and then.