I am getting this error
"Makefile:181: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop." What is this error and how to fix it?
Make sure you install Kernel Headers Package.
I just happen to need to install it also on my own server and got the same error when trying to use the virtualbox in debian repos. I went ahead and added VirtualBox repo and installed from there. This is better because they are more up-to-date.
Add line below for squeeze
Then add the The Oracle public key for apt-secure
then run update and to install latest 4.2
Install the dkms package to ensure that the VirtualBox host kernel modules are up to date
Should be good to go. Got these instructions from VirtualBox's website for Linux which seems to be down at the moment but the link is https://www.virtualbox.org/wiki/Linux_Downloads
How to fix this but for Fedora
First make sure that your installed packages (especially kernel) are up to date:
After this compiling VirtualBox kernel modules should works without any problems.
@hhh You should search only for
So, in my case, I have an 64-bit architecture, I have to install
Another thing is
I had the KERN_DIR error in CentOS. Reviewed the shell install script, and found that it sets KERN_DIR to /usr/src/kernels. Then did "uname -r" shows I was running a lower version of the kernel ... than the source code under /usr/src/kernels.
I looked at /boot/grub/menu.lst ... and confirmed the kernel mismatch. Weird.
So fix was ... "yum -y update kernel", then reboot. VMWare tools then got installed.
Then reboot your machine