Oracle VM VirtualBox settings share files with virtual machines

Source: Internet
Author: User
Tags oracle vm virtualbox vm virtualbox

Article reproduced from http://wenku.baidu.com/link?url=5uZ1xWnGC55FGW2XUqzLVdttRcik2xCqwRKEdh6z-nZJ63UQn3j2750ES_ Q4orotse26r3yl36uzrgz_cusbur4cqyomc9r4dw4otqowdv_

Environment: Host operating system is Windows 7, virtual machine is CentOs6.5 (RedHat Enterprise version same), virtual machine is VirtualBox 4.3.20.

1. Install the enhanced Feature Pack (guest additions)
After installing CentOs5.5, run CentOs5.5 and log in. Then select "Device (Devices)", "Install Guest additions" in the VirtualBox menu.
You will find an extra disc icon on the CentOs5.5 desktop, which is automatically loaded into the folder/media/vboxaddition_3.2.10_66523 by default (this name may vary depending on the version). Enter the command line terminal and enter:
#cd/media/vboxaddition_3.2.10_66523

#sudo bash./vboxaddition_3.2.10_66523-x86.run or sh vboxaddition_3.2.10_66523-x86.run

Specify kern_dir=<directory> Baidu Find a solution
Install Kernel-devel and kernel-headers two packages, configure the build environment
First, install GCC.
#yum-y Install gcc
Re-install Kernel-devel and kernel-headers
#yum Install Kernel-devel kernel-headers

After the installation is complete, make a connection
Ln-s/usr/src/kernels/2.6.18-194.26.1.el5-i686/usr/src/linux
Note: Be sure to do this, otherwise the VirtualBox client enhancements will also be error-enabled during installation. where "2.6.18-194.26.1.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. #uname-R to view the kernel version.

Once the installation is successful, execute again
#cd cd/media/vboxaddition_3.2.10_66523
#sh Vboxaddition_3.2.10_66523-x86.run


Restart under
#lsmod |grep vboxsf
vboxsf 38088 0
Vboxguest 152104 7 vboxsf
Description loads the kernel module vboxsf

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

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

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

Oracle VM VirtualBox settings share files with virtual machines

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.