Error :Specify KERN_DIR= while Installing VirtualBox Guest Additions

Error :Specify KERN_DIR= while Installing VirtualBox Guest Additions

Issue Description

While installing Guest Additions faced with the following error

04-failed-to-install

You are advised to examine the log at /var/log/vboxadd-install.log to figure out the cause, which in my case the log included:

/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.

After searching from many sites ... got the first solution as

# cd /etc/yum.repos.d
Next, use yum to install everything you need to get that Guest Additions Installer to work!
# yum update

# yum install gcc
# yum install kernel-uek-devel
If the above installs succeeded, try the Guest Additions installer once again
 
But unfortunately it FAILED again.
This is mainly the issue with two type of kernel provided as pure Linux edition and Unbreakable type. and the latest VirtualBox seems to have problem with 'uek' ie. unbreakable edition kernel.
 
So I exported my machine to have .ova file, then uninstall VB 4.3.26 and got back to 4.2.26.
After Importing the same machine, unmount already created Guest edition ISO.
 
Go to terminal,
#yum update
check the folders in /usr/src/kernels directory
# ls /usr/src/kernels
from the output check out your version
# KERN_DIR = /usr/src/kernels/yourVersion
# export KERN_DIR
#cd /media/VBOXADDITIONS_4.2.26_98988

#sh ./VBoxLinuxAdditions.run

still got same error... just rebooted to have effects of update from yum.

DONE.  Able to install Guest Additions.

05-install-success

Environment

  • Host Machine on Windows 7 Operating System
  • Virtualization technology = Oracle Virtualbox 4.3.26
  • Guest VM Operating System = Oracle Enterprise Linux 6.6

 

Disclaimer - Views expressed in this blog are author's own and do not necessarily represents the policies of aclnz.com

Mass Change of Material Groups in Material Master ...
How to search a new line character and remove it f...