Créer les modules signés pour le SecureBoot
Virtualbox utilise des modules.
Si lors du démarrage d'une VM le panneau apparait :
Kernel driver not installed (rc=-1908) The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing '/sbin/vboxconfig' as root. If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information. where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
Installer les paquets nécessaires à la compilation :
apt install dkms build-essential linux-headers-amd64
Lancer la commande de génération des modules : sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: You must sign these kernel modules before using VirtualBox: vboxdrv vboxnetflt vboxnetadp See the documentation for your Linux distribution.. vboxdrv.sh: Building VirtualBox kernel modules. vboxdrv.sh: Signing VirtualBox kernel modules. vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why. There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
In the /var/log/syslog, il y a :
Loading of module with unavailable key is rejected vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.
Vérifier que le SecureBoot est bien actif : sudo mokutil --sb-state
Vérifier si une clé existe déjà : ls /var/lib/shim-signed/mok/
Si elle n'existe pas (pas de fichier disponible), créer avec :
mkdir -p /var/lib/shim-signed/mok/ cd /var/lib/shim-signed/mok/ openssl req -nodes -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -days 36500 -subj "/CN=My Name/" openssl x509 -inform der -in MOK.der -out MOK.pem
Ensuite, enroller la clé MOK.der (lui allouer un mot de passe) : sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
Reboot
Lors de l'étape BIOS, un menu "MOK Manager" doit apparaître pour demander le mot de passe
Vérifier que le MOK est correctement chargé : mokutil --test-key /var/lib/shim-signed/mok/MOK.der
Ajouter le support à DKMS en éditant /etc/dkms/framework.conf et ajouter :
mok_signing_key="/var/lib/shim-signed/mok/MOK.priv" mok_certificate="/var/lib/shim-signed/mok/MOK.der"Enfin, recréer les modules de VirtualBox : sudo /sbin/vboxconfig
Ils doivent maintenant être correctement signés et chargés.