After installing CentOS (or others, such as win7orubuntu) in VirtualBox, the screen resolution can only be, so that if your screen is not, it looks very inconvenient. In this case, you need to install the VBoxGuestAdditions_x.x.x.iso enhancement function. However, an error occurs during installation: Buildingthe & nbs
After installing CentOS (or others, such as win7 or ubuntu) in Virtual Box, the screen resolution can only be, so that if your screen is not, it looks very inconvenient. In this case, you need to install the VBoxGuestAdditions_x.x.x.iso enhancement function.
However, an error occurs during installation:
Building the main guest addition modules [Failed]. (Your system does not seem to be set up to build kernel modules. Look at/var/log/vboxadd-install.log to find out what wrong)
Building the main guest addition modules [Failed]. (Your system does not seem to be set up to build kernel modules. Look at /var/log/vboxadd-install.log to find out what went wrong)
At the same time, the following error is found in the file/var/log/vboxadd-install.log:
Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR = And run Make again... Stop.
Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=
and run Make again.. Stop.
Test Environment: Mac OS 10.9.4, Virtual Box-4.3.14-95030, CentOS-7.0-1406-x86_64-GnomeLive
Solution:
First, check your kernel version: (my version is 3.10.0-123. el7.x86 _ 64)
- Uname-r
uname -r
Then, check whether you have installed kernel-devel and whether the version number is consistent with that of kernel: (version 3.10.0-123.6.3.el7.x86 _ 64, inconsistent)
Rpm-q kernel-devel
rpm -q kernel-devel
If not, run the following command:
Yum install kernel-devel
yum install kernel-devel
If the two are inconsistent, update the kernel:
- Yum update kernel
yum update kernel
Next, install some necessary programs:
Yum install gcc
yum install gcc
Finally, you can install VBoxGuestAdditions_x.x.x.iso: (first, use the root permission to enter the iso folder)
./VBoxLinuxGuestAddition. run
./VBoxLinuxGuestAddition.run
Reboot.