07-07-2014, 11:02 PM
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:
If we look at the log file.
The thing that stands out is:
Download the VirtualBox repo file so that it will be included whenever you run the yum update command:
It turns out the problem was that kernel headers were not installed.
Check what Kernel you have installed.
You will get an output something like:
See what kernel headers are installed, it won't return anything if non are installed.
Install kernel headers/
Check kernel headers again.
It will return something like:
Specify the KERN_DIR
Echo KERN_DIR to confirm that you've set it up properly:
Export the KERN_DIR
Re-Run the guest additions setup
Run the installer
I was then getting a different error in in /var/log/vboxadd-install.log
Check that the kernel is the same as kernel-devel
Install the latest kernel for your distro
Reboot
Reset the KERN_DIR
export the KERN_DIR
Re-Run the guest additions installer
It should now install OK. If it does, reboot one last time and that should be it.
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.