ns am trying to download virtualbox5.2 top top a RHEL 7 VM once I try to rebuild kernels modules I acquire the complying with error:

myserver~># /usr/lib/virtualbox/vboxdrv.sh setupvboxdrv.sh: preventing VirtualBox services.vboxdrv.sh: structure VirtualBox kernel modules.This system is right now not set up to build kernel modules.Please download the Linux kernel "header" files corresponding the present kernelfor adding brand-new hardware support to the system.The distribution packages comprise the headers are probably: kernel-devel kernel-devel-3.10.0-693.11.1.el7.x86_64I tried download kernet-devel and got success message

Installed: kernel-devel.x86_64 0:3.10.0-693.21.1.el7 Complete!But still the setup fails.

You are watching: This system is currently not set up to build kernel modules

Any idea what is absent here?


*

sudo yum install -y "kernel-devel-$(uname -r)"

Substitute dnf top top Fedora. Ns didn"t should do a reboot, but ymmv.

Edit for 2020:

Centos/RHEL 8 now also use dnf rather of yum. Ns haven"t had actually occasion to test this ~ above those distros, so the exact same YMMV disclaimer quiet applies.


*

First operation in terminal: uname -r climate you will get name and also information around current kernel (CURRENT_KERNEL).

Now you can install v command: yum install kernel-devel-CURRENT_KERNEL

Note: replace CURRENT_KERNEL with string you get from uname -r.


*

The very same message happened when ns tried to upgrade VirtualBox 5.2.12 Guest enhancements on my Kali Linux (GNU/Linux roll version). I addressed it by following steps:

Do apt update/upgrade to store your system up-to-date. Do not forget to reboot the system.Run "apt-get download linux-headers-$(uname -r)".Run VBoxLinuxAdditions.run native terminal, error message gone and also Guest additions will be installed successfully. Reboot system, Guest additions works fine.
*

*

I gained here looking for the exact same answer for CentOS 6, and also the over answers operated with slight alteration (so, because that anyone else the lands here too)...

yum install -y kernel-devel kernel-devel-$(uname -r)So, "yum" rather of "apt-get"Also, part Linux usage "linux-headers" rather of "kernel-devel" but the principle appears to be the same.


The kernel your were utilizing was kernel-devel-3.10.0-693.11.1.el7.x86_64 is slightly different with the one the you mounted kernel-devel.x86_64 0:3.10.0-693.

See more: How To Clean Bissell Little Green Brush, I Can’T Seem To Remove The Clear Piece

21.1.el7 . In mine case, there room several various version installed on mine OS, and "sudo yum install kernel-devel" always install the newest one because that me. Then I work-related it the end by setup my default kernel version as exact same as yum mounted for me. You can check the kernel you have installed on your OS by adhering to command:

sudo awk -F" "$1=="menuentry " print i++ " : " $2" /etc/grub2.cfgThen just set the kernel variation you select to use as exact same as yum select for you,by following command:(notice that the number at critical is choose up from coming before command result),

sudo grub2-set-default 0generate the grub2 config through "gurb2-mkconfig" command, and then reboot the server.