modprobe vboxguest failed

I had this problem today, and solved it by installing the kernel-headers

yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers 

then

yum install kernel-devel

or

yum install kernel-PAE-devel

Then re-run VBoxLinuxAdditions.run.


I discovered here that the standard guest additions install includes a built-in setup function, so there's no need to reinstall:

/etc/init.d/vboxadd setup

This gave me the error about missing kernel sources, so as brendan's answer, yum install kernel-devel, and then that setup command works, and everything seems to be back to normal again!


I had a similar problem today, but it turns out the vagrant-vbguest plugin was not installed. So, in the folder with my Vagrantfile:

vagrant plugin install vagrant-vbguest

That solved it for me.


When installing from an ISO that has had point fixes made to it, the kernel-devel headers will most likely be a newer version than the kernel that shipped with the ISO.

You need to make sure everything is up to date and in lockstep.

What worked for me on a CentOS 8 install was the following:

  1. sudo yum update
  2. sudo yum install binutils gcc make patch libgomp glibc-headers glibc-devel elfutils-libelf-devel kernel-headers kernel-devel
  3. sudo reboot
  4. Insert VBox Guest Additions again

Had the same problem on a Debian guest. Based on dualed's answer:

  1. Find out your kernel architecture, i.e.:

    $ uname -r  
    4.9.0-3-686
    
  2. Install make and the kernel headers (replace "686" with your architecture: "amd64", "686-pae",...):

    $ sudo apt install make linux-headers-686
    
  3. Finally, install the Guest Additions:

    $ sudo sh ./VBoxLinuxAdditions.run