Skip to content

Instantly share code, notes, and snippets.

@kuchibs
Last active January 19, 2018 15:10
Show Gist options
  • Save kuchibs/347b4e4262fa8077618d62f88ab981db to your computer and use it in GitHub Desktop.
Save kuchibs/347b4e4262fa8077618d62f88ab981db to your computer and use it in GitHub Desktop.
Install Virtualbox on CentOS7.x - vbox-install.log: Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.

Install virtual box

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

In case of windows vmware vm

Image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment