Unable to execute vagrant up command

Hello Community.

I have set up a lab for test purposes.

I have successfully installed Virtualbox7 and sucessfully installed Hashicorp Vagrant. I wanted to learn how to provision an Ubuntu 22.04 server on virtualbox using vagrant. I run the vagrant init command and edited the Vagrantfile with the following parameters.

 Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/bionic64"
  config.vm.network "public_network"

However, when i issue the vagrant up command, i get the error below:

$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
Error while connecting to Libvirt: Error making a connection to libvirt URI qemu:///system:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory

Issuing an additional command:

$ vboxmanage showvminfo
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (5.14.0-362.24.1.el9_3.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.
Usage - Show configuration information or log file contents for a virtual machine:

I receive the error above.

How do i resolve this error:

WARNING: The vboxdrv kernel module is not loaded.

I checked if virtualization is enabled:

$ lscpu | grep Virtualization
Virtualization:                     VT-x

I tried to build the kernel modules:

$ 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 documentation for your Linux distribution..
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Signing 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.

Restarting the process did not help.

Kindly help me.

The last message you posted, suggests problems with secure boot and signing the kernel modules. Have you tried disabling secure boot in your BIOS?

I have disabled secure boot on BIOS , and now the vagrant up command runs okay.

Doesn’t disabling the secure boot make my system less secure ?

Is there a way to have it remain enabled and still be in a position to achieve the intended purpose?

Thank you @iwalker

Yes, you would have to sign the virtualbox modules so that it would work with secure boot (which is in the error message you posted). I don’t know how to do that, I haven’t searched to be honest. But I would say it’s far easier disabling secure boot. Whether that is a problem or not, in terms of less secure is another matter of which you have to decide which solution is best.

I don’t have a problem with disabling secure boot. Up until one point it never existed anyway, and I’ve never had issues. That’s not to say it will never happen anyway, but there we go.

1 Like

Thank you , i really appreciate your reply.

1 Like

I use Virtaulbox with secure boot. This is on a Fedora machine and I’ve installed it from the rpmfusion repository along with the required akmods and kmods. The vbox drivers are already signed when built all you have to do is load the certs with the “mokutil” command. These certs can be found in /etc/pki/akmods/ along with the script that created them.
man mokutil explains how to enroll the certs. Once you’ve enrolled the certs you have to reboot and depending on the firmware you will either be prompted to register the certs before grub menu or you will have to enter the firmware and find the cert management menu.

2 Likes

Thank you.

I will try this one out.

Much appreciated :pray:

@jbkt23