I started using Centos 8 recently, and I installed VirtualBox to manage my virtual machines,
the problem that I encountered with is that my VirtualBox couldn’t boot any VMs and it told me to execute this script /sbin/vboxconfig
as root, when I run this script the following message appears :
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: You must sign these kernel modules before using VirtualBox:
vboxdrv vboxnetflt vboxnetadp vboxpci
See the documenatation for your Linux distribution..
vboxdrv.sh: Building 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.
Note that my secure boot is enabled.
My question is how to sign these kernel modules in Centos 8 ?
3
Answers
After some research, I found the solution.
Solution 1 : disable secure boot.
Solution 2 :
1- Install
mokutil
package2- Create RSA key under new folder.
3- This command will ask you to add a password, you need this password after the next reboot.
4- Reboot your system and a blue screen appear, select Enroll MOK --> Continue --> put the previous password and your system will start.
5- Put the previous cmmands in a script to run it later (after system update)
Add the following cmd to this script :
Use the below to find signfile if the above fails & edit script accordingly.
5- Add exec permission and run the script
6- Launch VirtualBOx
For more info see this link (for ubuntu users) https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/
I upgraded from virtualbox 6.0 to 6.1 and vboxconfig ran without an error (or the need to sign kernel modules).
I follow the solution given by @Younes LAB but I needed to change the
sign-file
path in thesign-virtual-box
script for it work fine:I am using Ubuntu 20.04.2 LTS and VirtualBox 6.1