Linux CENTOS: vbox-install.log: Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again.
yum install epel-release -y
uname -a
cd /usr/src/kernels/
Here, initially, there will be nothing. Now install kernel of same number
yum install kernel-devel
– this will give closest one
Again check cd /usr/src/kernels/
If it does not match, uname –a, then, get download proper rpm and install
wget http://ftp.riken.jp/Linux/cern/centos/7/updates/x86_64/Packages/kernel-devel-3.10.0-327.4.5.el7.x86_64.rpm
rpm -ivh kernel-devel-3.10.0-327.4.5.el7.x86_64.rpm
Now, set the KERN_DIR
export KERN_DIR=/usr/src/kernels/3.10.0-327.4.5.el7.x86_64
Reboot the vm - important
Now, get virtual box and install it
wget http://download.virtualbox.org/virtualbox/5.2.4/VirtualBox-5.2-5.2.4_119785_el7-1.x86_64.rpm
rpm -ivh VirtualBox-5.2-5.2.4_119785_el7-1.x86_64.rpm
vim /var/log/vbox-install.log
ALWAYS: Check the install log and make sure here are no errors in this file above.
Now, you will get “This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory” Go to VC, edit settings, CPU and enable the option
Note, I have not installed Desktop here- hence VB can not be seen in GUI!
To test if virtual box is installed vboxmanage --version