VirtualBox CentOS installation enhancement tools and issues

Source: Internet
Author: User

VirtualBox CentOS installation enhancement tools and issues

VirtualBox everyone habitually referred to it as Vbox, smaller than the size of the VM, open source, fast. However, after installing CentOS in a virtual machine using VirtualBox, it is not possible to run the client-side enhancements installed VirtualBox directly, which requires a simple configuration to properly install VirtualBox client enhancements in the CentOS virtual machine. Here's a look at Ownlinux's "Installing VirtualBox Client Enhancements for CentOS 5.5 virtual machines" tutorial.


1. Start the CentOS 5.5 virtual machine installed in VirtualBox and click "Device" + "Install enhancements".

At this point you can see that a "disc" has been mounted on the CentOS 5.5 desktop. It contains the components that install the VirtualBox client enhancement feature.

Note: Normally we run the components that are mounted to the VirtualBox client enhancements in the system directly, but CentOS needs to be configured, and if you install directly, the following error will occur.

Bulding the VirtualBox Guest additions Kernel modules failed
Your system does not seem to is set to build kernel modules.
Look At/var/log/vboxadd-install.log-Find out-what went worg. Once you have corrected it,you run
/etc/init.d/vboxadd Setup
To build them

2. You need to install the relevant components of the compiled kernel.


Yum Install kernel-devel gcc


3. After the installation is complete, make a connection


Ln-s/usr/src/kernels/2.6.18-164.15.1.el5-i686/usr/src/linux
Which, the bold part, can be directly with the help of the "tab" key
Note: Be sure to do this, otherwise the VirtualBox client enhancements will also be error-enabled during installation. where "2.6.18-92.1.18.el5-i686" is the kernel version number, the different versions may not be the same, you have to fill in according to your own system kernel.

All of the above in the terminal operation, can be executed in the terminal at any location, in order to ensure security, at the time of execution, all terminals are directly using the "Application System"-"accessories"-"terminal", open the terminal, to the "root".

Since the VirtualBox "Device"--"install enhancements" have been performed before, there is a name on the desktop called: vboxadditions_3.1.6_ 59338 VirtualBox Virtual CD-ROM (the name may vary depending on the VirtualBox version), double-click to open, find many files (after performing the above actions, double-click the autorun.sh file should be able to automatically perform the installation operation).


4. Install the VirtualBox Client Enhancements tool.

Choose the VirtualBox Client Enhancement tool that is consistent with your system to install, where Vboxlinuxadditions-x86.run applies to the 32 system, Vboxlinuxadditions-amd64.run is for 64-bit systems.
Execute the following command to install
Sh./vboxlinuxadditions-x86.run

Virtual opportunity automatically installs the enhancement function, restarts the virtual machine, the mouse again does not have to switch back and forth manually!

It is said that the "NAT" mode of network connection, all virtual machine network connection content, all need to go through the host network, so there may be a host and virtual machine access to the network at the same time the problem of slow speed.

In addition, the VirtualBox website clearly pointed out the support CentOS, but in the new virtual machine, why not directly to the CentOS option? Because CentOS is actually a community version of Redhat. Basically the same as the free version of Redhat. So when it's time to build, choose Redhat.

5. Setting up Shared Folders

Restart Complete in the VirtualBox menu, click "Devices (Devices)", and assign a data space (shared Folders) menu, add a shared folder, options fixed and temporary refers to whether the folder is persistent. Try to use the English name. I use winshare here.

6. Mount the shared folder


Re-enter the virtual CentOs5.5 and enter it at the command line terminal:
#sudo Mkdir/mnt/share
#sudo mount-t vboxsf Winshare/mnt/share

If prompted/sbin/mount.vboxsf:mounting failed with the Error:no such device
may not be loaded kernel module VBOXFS, first look under:
#lsmod | grep vboxsf
If no results are returned, the description vboxsf is not loaded, execution
#sudo modprobe vboxsf

Normal Mount-t vboxsf winshare/mnt/share the shared folder should be accessible
#cd/mnt/share
#ls-al

If you do not want to manually mount each time, you can add an item to the/etc/fstab
Share/mnt/share vboxsf Rw,gid=100,uid=1000,auto 0 0
This will automatically be mounted.
I do this, but each boot is not hooked up, so use the following method to execute the hook script at system startup, successfully automatically hook up

#vi/etc/rc.d/rc.local

At the end of the file, join the command that was manually hooked up, such as:

Mount-t vboxsf Sharefolder/share

7. Lifting the Mount


#sudo umount-f/mnt/shared
Note: The name of the shared folder must not be the same as the name of the mount point (I did not experiment, but it is not necessary). For example, the above mount point is/mnt/share, if the name of the shared folder is also share, the following error message will appear when mounted (http://www.virtualbox.org/ticket/2265):
/sbin/mount.vboxsf:mounting failed with the Error:protocol error
Reason analysis can see tips on running Sun VirtualBox's shared Folder on a Linux guest section.

VirtualBox CentOS installation enhancement tools and issues

Related Article

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.