31

I am running an Ubuntu Server (12.0.4-beta2; kernel 3.2.0) in VirtualBox (host is Win7) and I want to use shared folders. I've followed the manual to set up vbox guest additions http://www.virtualbox.org/manual/ch04.html#idp5801200 but this error occurs with every startup:

Starting the VirtualBox Guest Additions ...fail!
(modprobe vboxguest failed)
Starting VirtualBox Guest Addition service VirtualBox Additions module not loaded!

When I try it myself:

$ modprobe vboxguest
FATAL: Module vboxguest not found.

Did I do something wrong, what do I need to fix it? Thanks for help.

A123321
  • 413
  • 1
  • 4
  • 5

9 Answers9

28

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.

brendan
  • 425
  • 4
  • 5
  • For people coming across this in the future, this did the trick perfectly for me on a fresh install of CentOS 6.2 – AndyPerfect May 16 '12 at 23:25
  • 1
    This works because `VBoxLinuxAdditions.run` *compiles* the VirtualBox kernel modules, but doesn't quite mention this when it fails. – Piskvor left the building Feb 27 '14 at 16:10
  • 2
    Aaargh. Why do I always forget this... for Debian / Ubuntu this would be `apt install gcc make linux-headers-amd64` - enjoy. – dualed Jun 02 '17 at 16:57
  • 2
    THis doesn't work for me. Is there some other undocumented step required now in 2017? – MidnightJava Aug 08 '17 at 01:26
  • @MidnightJava Maybe you have to reboot after installing the kernel stuff. That seems to be the main difference between this answer and the answer below that worked for me, by wski. (for CentOS 8 at least). – gamingexpert13 Sep 15 '21 at 00:56
  • OP's VM is running Ubuntu. What are the `apt` versions of these commands? – David Knipe Nov 16 '21 at 16:36
7

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!

robert
  • 194
  • 1
  • 5
6

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.

oalders
  • 163
  • 1
  • 4
4

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
wski
  • 141
  • 3
3

on Centos 8, first run

sudo yum install elfutils-libelf-devel
  • 2
    Can you explain *why* the OP should run these commands first? Please see [answer] and take our [tour] to learn how to improve your answer. – Burgi Oct 09 '19 at 11:37
2

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
    
Rock Storm
  • 41
  • 3
1

I followed till this below : None of them cleared issue. After below step, worked fine.

sudo yum install elfutils-libelf-devel

My environment: OVM : 6.1 Oracle Linux 7.9

0

I had this same problem. I had 2 kernels installed and therefor also 2 kernel-headers. I removed the old kernel-headers that I don't use/boot that kernel. It did say this even when successful:

VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all

I have no idea how to do the above.

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 03 '22 at 18:42
-1

I've found this and sort everything out!:

yum install kernel-uek-headers-$(uname -r)

yum install kernel-uek-devel-$(uname -r)

it's intall what VBoxLinuxAdditions.run needs.

devel7316
  • 1
  • 1