Use CentOS to access Shared Files in Windows

Source: Internet
Author: User

Using the virtual CentOS to access Shared Files in Windows, VirtualBox is installed in Windows 7, and CentOS 5.6 is installed in VirtualBox. Now you want to access some files in Windows in CentOS, you need to configure the data space in VirtualBox: VirtualBox 4.0.8 [root @ zuantianyang-lnx ~] # Lsb_release-aLSB Version: core-4.0-amd64: core-4.0-ia32: core-4.0-noarch: graphics-4.0-amd64: graphics-4.0-ia32: graphics-4.0-noarch: printing-4.0-amd64: printing-4.0-ia32: printing-4.0-noarchDistributor ID: CentOSDescription: CentOS release 5.6 (Final) Release: 5.6 Codename: final1. install VirtualBox Guest Addition. Click "Install enhancement" under the "device" menu ": [root @ zuantianyang-lnx ready] $ ls-lrt total 37520-r-xr-xr-x 1 root 278832 05-31 VBoxWindowsAdditions.exe-r-xr-x 1 root 9284432 05-31 VBoxWindowsAdditions-amd64.exe-r-xr-xr-x 1 root 14664192 05-31 VBoxSolarisAdditions. pkg-r-xr-x 1 root 7853516 05-31 22: 17 VBoxLinuxAdditions. run-r-xr-x 1 root 5523 05-31 22: 17 ru Nasroot. sh-r-xr-x 1 root 6966 05-31 22: 17 autorun. sh-r-xr-x 1 root 647 05-31 22: 17 AUTORUN. INFdr-xr-x 2 root 4096 05-31 64Bitdr-xr-xr-x 3 root 4096 05-31 32Bit-r-xr-xr-x 1 root 6190464 05-31 VBoxWindowsAdditions-x86.exe [root @ zuantianyang-lnx VBOXADDITIONS_4.0.8_71778] $. /VBoxLinuxAdditions. run 2. in VirtualBox settings, find the data space, add the folder to be shared, and select Auto-Mount and fixed allocation: Device --> allocate Data Space --> add data space I select drive C under Win7, Data Space Location C: \, data space name C_DRIVE 3. confirm/sbin/mount. vboxsf exists 4. check whether the boxvfs module is loaded: lsmod | grep vboxvfs. If it is not loaded, run the modprobe vboxvfs command to load 5. create a mount point: [root @ zuantianyang-lnx ~] # Cd/[root @ zuantianyang-lnx/] # mkdir WIN7_C_DRIVE [root @ zuantianyang-lnx/] # mount-t vboxsf C_DRIVE WIN7_C_DRIVE C_DRIVE is the name of the data space, it corresponds to the shared Windows folder. 6. to enable the Windows folder to be accessed after the machine is restarted, mount the folder automatically after CentOS is restarted. Modify/etc/fstab and add C_DRIVE/WIN7_C_DRIVE vboxsf defaults 0 0 to save it, mount the windows shared directory C_DRIVE to/WIN7_C_DRIVE under CenOS [root @ zuantianyang-lnx ~] # Cd/etc/[root @ zuantianyang-lnx etc] # vi fstab/dev/VolGroup00/LogVol00/ext3 defaults 1 1 LABEL =/boot ext3 defaults 1 2 tmpfs/dev /shm tmpfs defaults 0 0 devpts/dev/pts devpts gid = 5, mode = 620 0 0 sysfs/sys sysfs defaults 0 0 proc/proc defaults 0 0/dev/VolGroup00/LogVol01 swap defaults 0 0 # Automatically mount Windows7 C_DRIVE to/WIN7_C_DRIVE during startup, byrneyang. c_DRIVE/WIN7 _ C_DRIVE vboxsf defaults 0 07. unmount # sudo umount-f/mnt/sharedBuilding the VirtualBox Guest Additions kernel modules FAILD friends who use VirtualBox to install Linux often install the enhanced tool Guest Addtions at the same time, the main purpose of this tool is to allow the mouse to freely shuttle between the real machine and the virtual machine, and automatically change the X size according to the size of the VirtualBox window. But it often encounters setbacks during installation! The reason is often the following: 1. when you click "Install Guest Additions", the virtual installation CD folder appears on the desktop, which contains the enhanced toolkit. However, if you need to install the enhanced package, you must have at least the read and execute permissions, however, you cannot modify the permission attribute of a CD file. Therefore, you need to copy the files in the CD file, create a folder on the desktop, and paste the file! Modify file permissions. Choose different files for Execution depending on the virtual system you install, such as installing Linux, on the chmod 777 VboxLinuxAdditions-x86.run. This is to install the Add tool:./VboxLinuxAdditions-x86.run (Note: To execute the VboxLinuxAdditions-x86.run under the current folder, you need to run the command on the terminal ). 2. when you execute. /VboxLinuxAdditions-x86.run, the system may also prompt you: Building the VirtualBox Guest Additions kernel modules [failure] This prompt appears, often indicates that you have not installed. -gcc. -make. -kernel-default-devel. -kernel-sources. -necessary software packages such as kernel-headers. You can find them from the system installation CD and install them to the system. When you install gcc, you may also be prompted about the dependency of the software package, follow the prompts to install the dependency package! 3. Note that the name of the data space should not be the same as the name of the folder you created under/mnt. For example, to share the tempfolder folder in the host system, the default name of the data space is tempfolder. The command can be: sudo mkdir/mnt/share/, which is basically no problem, after restart, your system will be more perfect! Conclusion: If you encounter dependency package problems during software installation, we recommend that you use YUM to install the software to get rid of the dependency package problem!

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.