Problem loading vboxdrv kernel module in CentOS 7.8.2003 kernel 3.10.0-1127.19.1.el7.x86_64

Discussions related to using VirtualBox on Linux hosts.
Post Reply
frog.tech
Posts: 2
Joined: 16. Oct 2020, 19:53

Problem loading vboxdrv kernel module in CentOS 7.8.2003 kernel 3.10.0-1127.19.1.el7.x86_64

Post by frog.tech »

Hello everyone,

I'm not an experienced linux user but I'm doing my best. I'm trying to make vitrualbox work in a new installation of CentOS 7.8.2003 (Core) with kernel 3.10.0-1127.19.1.el7.x86_64 as I mentioned in subject too.

Everything is going fine through the process of adding the oracle repo, installing VirtualBox-6.1.x86_64. But no luck when trying to start virtualbox...

Code: Select all

[root@localhost ~]# virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (3.10.0-1127.19.1.el7.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.
Qt FATAL: QXcbConnection: Could not connect to display
Aborted

Code: Select all

[root@localhost ~]# vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
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-3.10.0-1127.19.1.el7.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-3.10.0-1127.19.1.el7.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.

Code: Select all

[root@localhost ~]# systemctl status vboxdrv
● vboxdrv.service - VirtualBox Linux kernel module
   Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2020-10-16 18:11:15 EEST; 3h 46min ago

Oct 16 18:11:14 localhost.frog.tech vboxdrv.sh[669]: Building VirtualBox kernel modules.
Oct 16 18:11:15 localhost.frog.tech vboxdrv.sh[622]: This system is currently not set up to build kernel modules.
Oct 16 18:11:15 localhost.frog.tech vboxdrv.sh[622]: Please install the Linux kernel "header" files matching the current kernel
Oct 16 18:11:15 localhost.frog.tech vboxdrv.sh[622]: for adding new hardware support to the system.
Oct 16 18:11:15 localhost.frog.tech vboxdrv.sh[622]: The distribution packages containing the headers are probably:
Oct 16 18:11:15 localhost.frog.tech vboxdrv.sh[622]: kernel-devel kernel-devel-3.10.0-1127.19.1.el7.x86_64
Oct 16 18:11:15 localhost.frog.tech systemd[1]: vboxdrv.service: control process exited, code=exited status=1
Oct 16 18:11:15 localhost.frog.tech systemd[1]: Failed to start VirtualBox Linux kernel module.
Oct 16 18:11:15 localhost.frog.tech systemd[1]: Unit vboxdrv.service entered failed state.
Oct 16 18:11:15 localhost.frog.tech systemd[1]: vboxdrv.service failed.
I have already installed gcc make perl kernel-dev and no secure boot is enabled.

Some info that might be useful is that same virtualbox version was working without any problems in a preexisting installation with kernel 3.10.0-862.9.1.el7.x86_64 but after updated to newer kernel same problem there.

Any ideas will be highly appreciated.

Thanks in advance!
Last edited by frog.tech on 17. Oct 2020, 09:48, edited 1 time in total.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem loading vboxdrv kernel module in CentOS 7.8.2003 kernel 3.10.0-1127.19.1.el7.x86_64

Post by fth0 »

The log messages tell that you probably need to install a package named kernel-devel-3.10.0-1127.19.1.el7.x86_64, which contains the kernel headers matching your current kernel. Do you have this package installed?
frog.tech
Posts: 2
Joined: 16. Oct 2020, 19:53

Re: Problem loading vboxdrv kernel module in CentOS 7.8.2003 kernel 3.10.0-1127.19.1.el7.x86_64

Post by frog.tech »

fth0 thank you very much for your answer!

I feel completely stupid because I was so sure that I had already installed package kernel-devel-3.10.0-1127.19.1.el7.x86_64, but apparently hadn't!

After I installed it everything went fine. So now I still have issue with my preexisted installation that mention in my first post but I will try some more and I will post a new topic if needed.

Once again thanks allot.
Post Reply