2

I have a minimal CentOS 7 installation as a VirtualBox 5.0.16 r105871 guest on a Windows 8.1 host. uname -r reports "3.10.0-327.10.1.el7.x86_64".

When I try to run VBoxLinuxAdditions.run I get an error that "The headers for the current running kernel were not found" and suggesting I do yum install kernel-devel-3.10.0-327.10.1.el7.x86_64. Yet yum list kernel-devel shows that is already installed (as is kernel-headers and the appropriate version).

Adding some logging to vboxadd, I find that it is looking for headers in /lib/modules/3.10.0-327.10.1.el7.x86_64/build which turns out to be a dead link to a missing /usr/src/kernels/3.10.0-327.10.1.el7.x86_64. Indeed, /usr/src/kernels/ is empty.

Googling around suggests that many versions of CentOS require patches to VBGA for the installation to work but I don't see any such notes specific to CentOS 7 or that refer to missing kernel headers.

3

Prompted by https://serverfault.com/questions/613256/trying-to-remove-packages-with-yum-however-it-is-failing I did some clean up then yum list no longer showed kenel-devel so I installed it and /usr/src/kernels/ is no longer empty and installing the Guest Additions succeeds.

0

Mount VirtualBox Guest Additions drive: From device menu click on Install VirtualBox guest additions option and type the following command

yum install -y linux-headers-$(uname -r)

Copy the VBoxLinuxAdditions.run file from the drive to the root directory using following command:

cp /media/cd-rom/VBoxLinuxAdditions.run /root/

Make it executable and install it:

chmod 755 /root/VBoxLinuxAdditions.run
cd /root/Desktop
./VBoxLinuxAdditions.run

Reboot

0

By the way, now for CentOS 7, open-vm-tools is recommended officially.

$ ./vmware-install.pl

open-vm-tools packages are available from the OS vendor and VMware recommends using open-vm-tools packages. See http://kb.vmwaare.com/kb/2073803 for mroe information.

Do you still want to proceed with this installation? [yes]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.