MOK key error when using installer on ubuntu

Working on installing Whonix/Virtualbox on Ubuntu 25.10, but running into an error when the installer tries to add the vboxdrv module to the kernel using the MOK key that I set up. SInce I am on Ubuntu, the generated keys from the Virtualbox setup end up in /var/lib/shim-signed/mok/, which is different from the path that the installer is using (/var/lib/dkms/). I tried to work around this by generating another key in /var/lib/dkms/ using

$ sudo openssl req -new -x509 -newkey rsa:2048 -keyout mok.key -out mok.pub -nodes -days 36500 -subj “/CN=DKMS/”

$ sudo openssl x509 -in mok.pub -outform DER -out mok.der

then enrolling the key, reboot, enter password, etc. However, when I run the installer it gives the following error

$ whonix-lxqt-installer-cli: [NOTICE]: Command executing: $ sudo – modprobe vboxdrv
$ whonix-lxqt-installer-cli: [NOTICE]: secure_boot_mokutil_dkms_test_key: ‘Not a valid x509 certificate’
$ whonix-lxqt-installer-cli: [ERROR]: Secure Boot DKMS Signing Key Enrollment Check Result: ‘FAIL’

  • Secure Boot is enabled, but the DKMS signing key is not enrolled.
  • VirtualBox kernel modules cannot be loaded due to this issue.
  • For instructions on DKMS Signing Key Enrollment, visit:
    (secure boot instructions link)

$ whonix-lxqt-installer-cli: [ERROR]: Aborting.
$ whonix-lxqt-installer-cli: [NOTICE]: Executed script, function, command executed: ‘./softwareResources/whonix-lxqt-installer-cli’ ‘die’ ‘exit “${1}”’
$ whonix-lxqt-installer-cli: [ERROR]: Installer exited with code: ‘1’

Since the key is enrolled and in the right place this should not be happening, what am I missing?

I think something probably went wrong when you created the key; that message Not a valid x509 certificate has to come from the command mokutil --test-key "/var/lib/dkms/mok.pub" 2>&1. Source code line:

Ideally though the installer should just use the key in /var/lib/shim-signed/mok under Ubuntu. I see it doesn’t, but I think it should. @Patrick mind if I create a task for that?

1 Like

That would be good, yes.

1 Like