(SOLVED) Getting errors when trying to install Virtual Box on Fedora 34

VirtualBox-6.1-6.1.22_144080_fedora33-1.x86_64. Newbie here. I’m trying to follow the instructions here: https://computingforgeeks.com/how-to-install-virtualbox-on-fedora-linux/
Anyway to fix this?

ERRORS 1:

This system is currently not set up to build kernel modules.
Please install the Linux kernel “header” files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.12.13-300.fc34.x86_64
This system is currently not set up to build kernel modules.
Please install the Linux kernel “header” files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.12.13-300.fc34.x86_64

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.

Verifying : SDL-1.2.15-46.fc34.x86_64 1/2
Verifying : VirtualBox-6.1-6.1.22_144080_fedora33-1.x86_64 2/2

Installed:
SDL-1.2.15-46.fc34.x86_64 VirtualBox-6.1-6.1.22_144080_fedora33-1.x86_64

Complete!
[m3110w@fedora ~]$


ERRORS 2:

m3110w@fedora ~]$ newgrp vboxusers
Password:
newgrp: failed to crypt password with previous salt: Invalid argument
[m3110w@fedora ~]$ newgrp vboxusers
Password:
newgrp: failed to crypt password with previous salt: Invalid argument
[m3110w@fedora ~]$

Fedora’s best party trick is running virt-manager ~seamlessly as it’s so close to Red Hat compared to other desktop distros, it’s one of the reasons I moved to Fedora. I’ve used VirtualBox for ~4-5yrs but it was always kinda jenk so virt-manager may be worth a look.

I was not able to replicate your problem from a fresh Fedora VM following the instructions you linked. You might try the following:

# Confirm the repo was added per the guide
cat /etc/yum.repos.d/virtualbox.repo 

name=Fedora - - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/34/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc

sudo dnf update

# Run these again to confirm installation
sudo dnf -y install @development-tools
sudo dnf -y install kernel-headers kernel-devel dkms elfutils-libelf-devel qt5-qtx11extras

# Restart VirtualBox config process
sudo /sbin/vboxconfig

# Reboot
virtualbox

This part may be the problem as I don’t have Secure Boot in a VM:

If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci)

I got a different error on my install

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (5.12.14-300.fc34.x86_64) or it failed to
load. Please recompile the kernel module and install it by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.

which I fixed by running sudo /sbin/vboxconfig if you get to that point.

Thanks for your instructions. I was following your instructions and they were working. But when I ran sudo /sbin/vboxconfig I got some errors. See below.
Did I mess up something? Does VBox not work on EFI secure boot systems? If we (uh… you) can’t get my VBox working I will happily try virt-manager.

Should I try to uninstall VBox? I need to run a Debian distro in a virtual machine. One of my apps I need does not run on Fedora.

Is ‘m3110w’ my user name?

[m3110w@fedora ~]$ sudo dnf -y install kernel-headers kernel-devel dkms elfutils-libelf-devel qt5-qtx11extras
Last metadata expiration check: 2:42:08 ago on Sun 11 Jul 2021 03:32:40 PM IST.
Package kernel-headers-5.12.13-300.fc34.x86_64 is already installed.
Package kernel-devel-5.12.14-300.fc34.x86_64 is already installed.
Package dkms-2.8.4-2.fc34.noarch is already installed.
Package elfutils-libelf-devel-0.185-2.fc34.x86_64 is already installed.
Package qt5-qtx11extras-5.15.2-3.fc34.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[m3110w@fedora ~]$ 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 documenatation for your Linux distribution…
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel “header” files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.12.13-300.fc34.x86_64
This system is currently not set up to build kernel modules.
Please install the Linux kernel “header” files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-5.12.13-300.fc34.x86_64

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.
[m3110w@fedora ~]$

Here’s a pic of the direc that has the Exodus for Linux files that I downloaded. Imgur: The magic of the Internet Can Exodus somehow be installed into Fedora from these files?

Yes and your host’s name (computer name) is fedora


There’s 2 options…

  1. Disable Secure Boot in your BIOS and run those commands again.

If you’re not using Full Disk encryption (which I strongly recommended), there’s no point in Secure Boot and i’d just disable it. I did a deep dive into Secure Boot a while back and unless you’re protecting your whole system from other OSs there’s not much point in protecting the front gate.

  1. This is beyond my experience but there’s a lot of answers to what you need a duckduck away. Search term would be:

“You must sign these kernel modules before using VirtualBox”

This one looks promising from the answers, backup everything first.

1 Like

As it’s only available for Debian you’d need the source code to compile against your Fedora environment with gcc and after working through all the dependency errors it “might” work. You’ll then need a way to know if there’s an update at which point you need to do that all again.

In this case i’d go for a VM.

1 Like

Sounds like I should uninstall Virtual Box and try virt-manager. That sound good? Can virt-manager run a Debian distro in a virtual machine?

I just clicked on the Exodus icon and it seems to be working good. Looks like I won’t need a VM after all for Exodus.

Oh nice!

I’ve fallen in the trap of recommending that you use what I use which is personal to my taste. I’d do some window shopping on the best VM managers available for Linux and play around till there’s one you like. Just take any recommendations with a huge bucket of salt.

For example i’ve recommended virt-manager but many see cockpit as a superior successor that’s way easier to use. There’s also Proxmox, Mist.io, oVirt and many many others.

That I know of cockpit and virt-manager work extremely well on Fedora but I haven’t tried the other options.

1 Like