Install the enhancement package and configure shared folders in virtualbox

Source: Internet
Author: User
Tags virtualbox shared folder

Virtualbox to install the enhancement package and configure the shared folder because data needs to be transmitted between the host and the virtual machine, you want to use the shared folder. However, the shared folder cannot be found in centos after the shared folder is set separately. Check whether you want to install the enhanced package. Well, by the way, it also solves the problem of mouse switch. The province always switches by right CTL, and the window can also be switched seamlessly, which is convenient. However, the enhanced toolkit in the vbox has always reported an error. I found it. I need to pay attention to it in a few places. VirtualBox is often referred to as Vbox, which is smaller, open-source, and faster than VM. However, after using VirtualBox to install CentOS in a virtual machine, you cannot directly run the client enhancement function installed with VirtualBox. You must simply configure it to install the VirtualBox client enhancement function on the CentOS virtual machine. Next, let's take a look at the graphic tutorial "installing VirtualBox client enhancement for CentOS 5.5 virtual machines" provided by OwnLinux. 1. Start the CentOS 5.5 virtual machine installed in VirtualBox, and click "device" => "Install enhancement ". At this time, you can see that a "cd" has been mounted to the CentOS 5.5 desktop. It contains components for installing VirtualBox client enhancement. Note: Normally, you can directly run the VirtualBox client enhancement component mounted to the system. However, you need to configure CentOS. If you install it directly, the following error will occur. Bulding the VirtualBox Guest Additions Kernel modules failedYour system does not seem to be set up to build kernel modules. look at/var/log/vboxadd-install.log to find out what went worg. once you have corrected it, you run/etc/init. d/vboxadd setupto build them 2. you need to install related components for compiling the kernel. Yum install kernel-devel gcc 3. after installation, connect ln-s/usr/src/kernels/2.6.18-164.15.1.el5-i686/usr/src/linux, you can directly use the "Tab" key to complete the operation. Note: You must perform this operation. Otherwise, the VirtualBox client will report an error during the installation process. "2.6.18-92.1.18.el5-i686" indicates the kernel version. Different versions may be different. You need to enter the version based on your system kernel. All the above operations on the terminal can be performed on the terminal at any location. To ensure security, all terminals directly use "Application System"-"attachment"-"terminal", open the terminal, and locate "root ". Because the virtualbox "device"-"Install enhancement" has been executed before, there is a name on the desktop: VBOXADDITIONS_3.1.6_59338 virtualbox virtual optical drive (the name may vary depending on the virtualbox version), double-click to open and find many files (after performing the preceding operations, double-click autorun. sh file should be automatically installed ). 4. Install the VirtualBox client Enhancement Tool. Choose the VirtualBox client enhancement tool that is consistent with your system to install, where the VBoxLinuxAdditions-x86.run works for 32 systems and the VBoxLinuxAdditions-amd64.run is for 64-bit systems. Run the following command to install sh./VBoxLinuxAdditions-x86.run virtual opportunity to automatically install the enhancement function, restart the virtual machine, the mouse no longer need to switch back and forth manually! It is said that the "NAT" network connection mode and the network connection content of all virtual machines must be carried out through the network of the host. Therefore, the network speed may be slow when the host and Virtual Machine access the network at the same time. In addition, the virtualbox website clearly states that it supports centos, but why not directly provide centos options when adding new virtual machines? Because centos is actually the Community version of redhat. It is basically equivalent to the free version of redhat. Therefore, you can select redhat During the creation. 5. set the Shared folder to restart. In VirtualBox, click "Devices"-> allocate data space (Shared Folders) to add a Shared folder, the fixed and temporary options indicate whether the folder is persistent. Try to use an English name. Here we use winshare. 6. mount the shared folder and enter the virtual CentOs5.5. On the command line terminal, enter # sudo mkdir/mnt/share # sudo mount-t vboxsf winshare/mnt/share. If the prompt "/sbin/mount" is displayed. vboxsf: mounting failed with the error: No such device may not be loaded into the kernel module vboxfs. First, check: # lsmod | grep vboxsf. If No result is returned, vboxsf is not loaded, run # sudo modprobe vboxsf if it is normal, mount-t vboxsf winshare/mnt/share shared folder should be accessible # cd/mnt/share # ls-al if you do not want to manually mount each time, you can add a share/mn item to/etc/fstab. T/share vboxsf rw, gid = 100, uid = 1000, auto 0 0 so that automatic mounting can be performed. I have done this, but it cannot be mounted at each start. Therefore, I use the following method to execute the Mount script when the system starts. The script is successfully automatically mounted # vi/etc/rc. d/rc. add the manually attached command to the end of the file, such as mount-t vboxsf folder Folder/share 7. unmount # sudo umount-f/mnt/shared note: the name of the shared folder must not be the same as that of the mount point (this is not an 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 is displayed during mounting:/sbin/mount. vboxsf: mounting failed with the error: Protocol error cause analysis can be found in the Shared Folder on a Linux Guest section of Tips on running Sun Virtualbox. Another details: after installing the customer's operating system (GuestOS) in VirtualBox, we recommend that you install the VirtualBox Enhanced Package (VirtualBox GuestAddition ), it is used to optimize the performance and availability of GuestOS (that is, to improve the performance of GuestOS and improve the user experience ). GuestAddition is essentially a set of drivers and applications installed on GuestOS. Note: After you double-click the downloaded enhancement package, you can see that the name of the enhancement package is displayed in the "global settings"-"extension" of VirtualBox, in fact, it is only from the enhancement package installation file to solve the relevant files and install them into VirtualBox in the form of plug-ins. The real GuestAddition is an ISO file in the installation file. It must be mounted and installed in GuestOS to take effect, especially when you reinstall GuestOS, "I have installed GuestAddition, and I can see it in extensions. Why is it useless? ", I didn't understand this before. VirtualBox GuestAddition functions: 1. mouse integration: you do not need to press the VirtualBox HostKey (right Ctrl by default) Key to automatically release the mouse from GuestOS, so that the mouse can be moved seamlessly between the Host and Guest OS. GuestAddition provides a GuestOS mouse driver, which can communicate with the HostOS mouse driver to achieve this. 2. Shared Folder: files can be exchanged between Host and Guest OS. By setting a folder on the Host OS and specifying it as a VirtualBox shared folder, you can access it in GuestOS as a network shared folder, even if GuestOS does not have a network. 3. Better video support: VirtualBox virtual graphics card only provides the most basic video features, while the graphics card driver in GuestAddition provides ultra-high resolution and 2D3D video acceleration. You can adjust the size of the VM window at will and the GuestOS will automatically adapt, just like setting any resolution in GuestOS. 4. Seamless window: this function is very powerful. When GuestAddition is not installed, the virtual machine window can only be an independent window. After GuestAddition is installed and the seamless window mode is enabled, GuestOS can jump out of the Virtual Machine window and embed it into the Host OS desktop, it works like a common Host OS application. Supported GuestOS: <Windows> and <Linux and Solaris running X Windows>. Shortcut Key for seamless mode: HostKey + L note: the default HostKey of VirtualBox is right ctrl. 5. General Host/Guest communication channel: this function is mainly related to programmers. The "Guest Properties (client Properties)" In GuestAddition provides a general string-based mechanism that allows you to exchange data between hosts and Guest to control or monitor GuestOS. For example, you can directly control the startup, running, and shutdown of the GuestOS program on the Host OS. 6. time Synchronization: for some reason, the system time of Host OS and Guest OS may not be synchronized. Although VirtualBox itself provides the synchronization function, the efficiency and method of time synchronization of GuestAddition are much better than that of VirtualBox itself. 7. Shared clipboard: You can copy and paste the clipboard between Host and Guest OS. 8. Automatic Logon: You can enable automatic logon to GuestOS, including using certificates. Install GuestAddition in CentOS 6.3. Before installing GuestAddition, you need to prepare CentOS for compiling and generating external core modules. (Original article: Before installing the Guest Additions, you will have to prepare your guest system for building external kernel modules .) for CentOS, Red Hat Enterprise Linux, and Oracle Enterprise Linux, we recommend that you run the following commands as root. 1. If your CentOS version is earlier than 6, you need to add a line of divider = 10 in/etc/grub. conf to pass this parameter to the core to reduce idle CPU load. 2. # yum update: upgrade all software of the system to the latest version. 3. # yum install gcc install and compile the system 4. # yum install kernel-devel install external core modules. 5. # restart reboot to make all updates or installations take effect. Now, all the preparations are complete. Install GuestAddition. 6. select "Device" -- "Mount CD/DVD-ROM" under the menu bar of the Virtual Machine window and select "CD/DVD-ROM image" to bring up the Virtual Media Manager window, find VBoxGuestAdditions in the resource browser. iso file (assuming that the Host OS is Windows), VBoxGuestAdditions. iso is usually located in the installation directory of VirtualBox. Note: The menu of the VirtualBox VM window is often hidden. The displayed shortcut key is HostKey + C. I am excited by this. So far, it is equivalent to inserting the GuestAddition Cd in the CentOS virtual machine. Next, you need to attach the CD. 7. # mount-t auto/dev/cdrom1/mnt to mount the disc. Note: by default, VirtualBox has two optical drives:/dev/cdrom and/dev/cdrom1. If the mount command is stuck for a long time after execution, and the message "you must specify the filesystem type" appears, you need to change the device name. I just got stuck in this step for a long time, and all my urine went out. Later I found that VirtualBox had two optical drives, nnd. 8. # After cd/mnt is mounted successfully, enter the Mount directory. 9. # sh./VBoxLinuxAdditions. run to install GuestAddition. The installation process takes a long time. The installation is successful, as shown in the following figure: OK, the entire installation is complete. Finally, restart the instance to make it take effect. # 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.