Adjust the screen size (resolution) in VirtualBox ).

Source: Internet
Author: User
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)

  1. 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:

 

  1. 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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.