2

I try to install VirtualBox Guest Additions on a CentOS 7 VM.

I installed the prerequisites via

sudo yum install perl gcc dkms kernel-devel kernel-headers make bzip2

then I "inserted" the Guest Additions CD image and the Guest Additions auto runner came up and ran.

However the Guest Additions installation errored out with

VirtualBox Guest Additions: Kernel headers not found for target kernel 3.10.0-1062.el7.x86_64.

For closer examination I issued the following commands in the Terminal shell of the VM:

$ ls /usr/src/kernels/
3.10.0-1062.18.1.el7.x86_64

and

$ uname -r
3.10.0-1062.el7.x86_64

Notice the ddition caharcters 18.1 in the installed headers copared to what the kernel reports. I guess that is the reason why he Guest Additions installation fails.

How can I fix this and install the Guest Additions?


A few more details:

2
  • Please install kernel-headers-$(uname -r) and kernel-devel-$(uname -r) and check again.
    – binarysta
    Apr 26, 2020 at 9:39
  • Thanks @binarysta! That did the trick. Do you write it up as an answer I can then accept, please?
    – halloleo
    Apr 26, 2020 at 15:50

1 Answer 1

5

Please install headers exactly based on your kernerl release.

sudo yum install kernel-headers-$(uname -r) kernel-devel-$(uname -r)

2
  • Do you know what causes this issue? Is it an incorrect version of Guest Additions? Jun 18, 2020 at 1:55
  • @what is the exact issue for you? basically vbox searches for kernel-headers and kernel-devel same as current kernel release, if it cannot find, it will fail.
    – binarysta
    Jun 18, 2020 at 7:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .