Installing VirtualBox-7.0 in OpenSUSE 15.x (or tumbleweed) from repo and UEFI Secure Boot Enabled

This is a simple/short how to for installing VirtualBox 7 in OpenSUSE 15

Here we are handling two problems:

  1. There is no repo for OpenSUSE 15.4 (we need to do a trick)
  2. There is no documentation on how to create proper UEFI secure boot MOK’s (owner keys) for the newer OpenSUSE which demands that the key will have special attributes like “codeSigning

so, here is the answer:

Step 1: basic instalation:

# Get/Install the repo...
wget -O /etc/zypp/repos.d/virtualbox.repo

# Workaround (there is no repo for 15.4, but 15.3 works fine)
sed -i 's/$releasever/15.3/g' /etc/zypp/repos.d/virtualbox.repo

# Install VBox7.0 (and accept the certificate) and kernel build tools
#  Repository:       VirtualBox for openSUSE 15.3 - x86_64
#  Key Fingerprint:  7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139
zypper install VirtualBox-7.0 kernel-default-devel

# add your user to group (replace myuser):
usermod -aG vboxusers myuser

Step 2: MOK Key Creation (Only For UEFI+Secure Boot Systems):

mkdir -p /var/lib/shim-signed/mok
openssl req -nodes -new -x509 -newkey rsa:4096 -addext "extendedKeyUsage = codeSigning" -outform DER -keyout /var/lib/shim-signed/mok/MOK.priv -out /var/lib/shim-signed/mok/MOK.der
# here, use a random two-use password for enrolling the key
mokutil --import /var/lib/shim-signed/mok/MOK.der

# In the EFI MOK Utility...
# Enroll the key... the password is the password that you entered in mokutil, you won't be asked again about this password.

Step 3: Install the extension pack

# Installing the extension pack (you can re-use this every time after you do zypper up):
VBOXVERSION=$(rpm -qa VirtualBox* | cut -d'-' -f3 | cut -d_ -f1)
wget "${VBOXVERSION}/Oracle_VM_VirtualBox_Extension_Pack-${VBOXVERSION}.vbox-extpack"
VBoxManage extpack install --replace "Oracle_VM_VirtualBox_Extension_Pack-${VBOXVERSION}.vbox-extpack"

Leave a Reply