• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing VirtualBox guest editions on Linux CentOS
#1
Installing VirtualBox guest editions on Linux Cent OS

After performing a fresh install of Cent OS 6.5, then trying to install VirtualBox Guest Additions failed.

Error message:
Quote:Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)

If we look at the log file.
Code:
less /var/log/vboxadd-install.log

The thing that stands out is:
Quote:Specify KERN_DIR=<directory> and run Make again.

Download the VirtualBox repo file so that it will be included whenever you run the yum update command:
Code:
cd /etc/yum.repos.d/
Code:
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo


It turns out the problem was that kernel headers were not installed.

Check what Kernel you have installed.
Code:
uname -r

You will get an output something like:
Quote:2.6.32-431.el6.x86_64

See what kernel headers are installed, it won't return anything if non are installed.
Code:
ls /usr/src/kernels/

Install kernel headers/
Code:
yum install kernel-headers kernel-devel gcc

Check kernel headers again.
Code:
ls /usr/src/kernels/

It will return something like:
Quote:2.6.32-431.20.3.el6.x86_64

Specify the KERN_DIR
Code:
KERN_DIR=/usr/src/kernels/2.6.32-431.20.3.el6.x86_64

Echo KERN_DIR to confirm that you've set it up properly:
Code:
echo $KERN_DIR

Export the KERN_DIR
Code:
export KERN_DIR

Re-Run the guest additions setup
Code:
cd /media/VBOXADDITIONS_4.3.12_93733

Run the installer
Code:
./VBoxLinuxAdditions.run

I was then getting a different error in in /var/log/vboxadd-install.log
Quote:KERN_DIR does not point to a directory. Stop.

Check that the kernel is the same as kernel-devel
Code:
rpm -qa kernel\* | sort

Install the latest kernel for your distro
Code:
yum install kernel
Quote:Installed: kernel.x86_64 0:2.6.32-431.20.3.el6

Reboot

Reset the KERN_DIR
Code:
KERN_DIR=/usr/src/kernels/2.6.32-431.20.3.el6.x86_64

export the KERN_DIR
Code:
export KERN_DIR

Re-Run the guest additions installer
Code:
cd /media/VBOXADDITIONS_4.3.12_93733
Code:
./VBoxLinuxAdditions.run

It should now install OK. If it does, reboot one last time and that should be it.
  Reply


Messages In This Thread
Installing VirtualBox guest editions on Linux CentOS - by Mark - 07-07-2014, 11:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  User is not in the sudoers file. This incident will be reported. CentOS Mark 0 6,157 07-07-2014, 10:47 PM
Last Post: Mark
  Installing Flagfox for Firefox Mark 0 5,432 22-05-2010, 10:24 PM
Last Post: Mark

Forum Jump: