Last active
October 9, 2017 15:23
-
-
Save Raffaello/098fa3d7fa5a720386eaa1fa8c4ff2b8 to your computer and use it in GitHub Desktop.
VirtualBox recompiling kernel with Secure Boot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
openssl req -new -x509 -newkey rsa:2048 -keyout vbox.keyout -outform DER -out vbox.der -nodes -days 36500 -subj "/CN=VBoxDrv/" | |
mokutil --import vbox.der | |
### after the reboot yo are able to add it to the secure boot, please select it. | |
reboot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### After reboot and signed vboxdrv and the others modules. | |
### selinux | |
# chcon unconfined_u:object_r:lib_t:s0 /usr/lib/virtualbox/vboxdrv.sh | |
### OR | |
# setenforce permissive | |
/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxdrv) | |
/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxnetflt) | |
/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxnetadp) | |
/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxpci) | |
#/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxguest) | |
#/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxsf) | |
#/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./vbox.keyout ./vbox.der $(modinfo -n vboxvideo) | |
systemctl restart vboxdrv | |
systemctl status vboxdrv | |
echo "now run sudo /sbin/vboxconfig" | |
/sbin/vboxconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reminder: SELinux can cause complication. simple solution set temporarly as permissive especially if you are using virtualbox rpm repository.