5
2
How? It gives an error.
[vagrant@localhost mnt]$ sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.16 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.16 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Building Guest Additions kernel modules.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details.
[vagrant@localhost mnt]$ cat /var/log/VBoxGuestAdditions.log
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Please check that you have gcc, make, the header files for your Linux kernel and possibly perl installed..
[vagrant@localhost mnt]$ cat /var/log/vboxadd-install.log
/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.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
That's not sufficient. It doesn't specify where they are, or what to set KERN_DIR to. – Chloe – 2017-04-07T05:16:44.513
@Chloe It only asks about KERN_DIR because it cannot find the headers, so it is offering the user an opportunity to specify a different location. But headers should be in place, in which case KERN_DIR will point to the default CentOS location, which is just fine. – MariusMatutiae – 2017-04-07T05:18:48.287