The VM won’t boot correctly unless I connect to the console, go into “Device Manager > Secure Boot Configuration” and then “Reset Secure Boot Keys”. After doing so the VM boot correctly.
Looking at the qemu.conf, I see
# Firmware (read only)
[drive]
file = "/opt/incus/share/qemu/OVMF_CODE.4MB.fd"
if = "pflash"
format = "raw"
unit = "0"
readonly = "on"
# Firmware settings (writable)
[drive]
file = "/dev/fd/4"
if = "pflash"
format = "raw"
unit = "1"
I don’t understand why it takes /opt/incus/share/qemu/OVMF_CODE.4MB.fd instead of /usr/share/OVMF/OVMF_CODE.secboot.fd. I tried to override systemd configuration in order to set the INCUS_EDK2_PATH to /usr/share/OVMF/ but that do nothing.
What am I missing to avoid resetting keys manually ?
I am not familiar with Talos, but I am wondering it’s got some custom linux kernel module(s) associated with it?
Secureboot requires signed kernel modules, so when you build a different application from code (e.g. zfs) it wont work out of the box unless it gets signed by a secureboot key. Linux (at least Debian) gives us a machine key for doing that (via the command mokutil). It conveniently provides a means of signing your own kernels so that they work with secureboot but it is a bit of an odd procedure to go through.
So, if this is the root of your problem you can try to get your systems key added to the chain of trust. See the instructions here, which further explains this and shows how I sign a zfs module built from source on a Debian server. You have to register your systems key into the chain of trust. I warn you, it’s “quirky”:
Of course, I am only guessing that this might be your problem so apologies if this just sends you down a different rabbit hole.