Sign virtual box modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) Centos 8 [closed]
After some research, I found the solution.
Solution 1 : disable secure boot.
Solution 2 :
1- Install mokutil
package
sudo dnf updatesudo dnf install mokutil
2- Create RSA key under new folder.
sudo -imkdir /root/signed-modulescd /root/signed-modulesopenssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VirtualBox/"chmod 600 MOK.priv
3- This command will ask you to add a password, you need this password after the next reboot.
sudo mokutil --import MOK.der
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)
cd /root/signed-modulesvi sign-virtual-box
Add the following cmd to this script :
#!/bin/bashfor modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do echo "Signing $modfile" /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 \ /root/signed-modules/MOK.priv \ /root/signed-modules/MOK.der "$modfile"done
Use the below to find signfile if the above fails & edit script accordingly.
find /usr/src -name signfile
5- Add exec permission and run the script
chmod 700 sign-virtual-box./sign-virtual-box
6- Launch VirtualBOx
modprobe vboxdrv
For more info see this link (for ubuntu users)https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/
I follow the solution given by @Younes LAB but I needed to change the sign-file
path in the sign-virtual-box
script for it work fine:
#!/bin/bashfor modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do echo "Signing $modfile" /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \ /root/signed-modules/MOK.priv \ /root/signed-modules/MOK.der "$modfile"done
I am using Ubuntu 20.04.2 LTS and VirtualBox 6.1
I upgraded from virtualbox 6.0 to 6.1 and vboxconfig ran without an error (or the need to sign kernel modules).