VirtualBox a shared folder with a Windows host under CentOS

Source: Internet
Author: User

One, set up shared folders

Create a shared folder in Windows (F:/share)

To set the path of a shared folder in VirtualBox

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/07/9929a51a8171a77ccf5b5de3295862d6.jpg-wh_500x0-wm_3 -wmp_4-s_1208653168.jpg "title=" 2017-11-07_234821.jpg "alt=" 9929a51a8171a77ccf5b5de3295862d6.jpg-wh_ "/>

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/07/4f43db18765f3a7df1468818db3b44db.jpg-wh_500x0-wm_3 -wmp_4-s_3687597799.jpg "title=" 2.jpg "alt=" 4f43db18765f3a7df1468818db3b44db.jpg-wh_ "/>

With this step, you can map the folders created in Windows to VirtualBox.


Second, install gcc,make,kernel-devel

Gcc,make,kernel-devel tools are required to perform the installation scripts for the enhanced tools , so you need to install them in advance

Execute the following command at the command line

Yum install-y gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel

When the installation is complete, shut down the operating system in the virtual machine.


Third, mount the image file of the enhancement tool

Open the settings for the virtual machine in the state of the CentOS shutdown in the virtual machine

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/07/84c7f0ba0fe4c3fea380a9c73a6a26c1.jpg-wh_500x0-wm_3 -wmp_4-s_2890820035.jpg "title=" 3.jpg "alt=" 84c7f0ba0fe4c3fea380a9c73a6a26c1.jpg-wh_ "/>

Select "Add Virtual Drive"


650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/07/a192d282b7428643a40232d25c65fa2b.jpg-wh_500x0-wm_3 -wmp_4-s_1766981075.jpg "title=" 4.jpg "alt=" A192d282b7428643a40232d25c65fa2b.jpg-wh_ "/>

Click "Select Disk"


Locate the ISO file "Vboxguestadditions.iso" in the dialog box that pops up

This file is typically installed under the VirtualBox installation path.

For example, my path is: D:\Program Files\oracle\virtualbox\vboxguestadditions.iso


650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/07/95380df24c4073b8d5ed0971a6ab2438.jpg-wh_500x0-wm_3 -wmp_4-s_3529981782.jpg "title=" 5.jpg "alt=" 95380df24c4073b8d5ed0971a6ab2438.jpg-wh_ "/>

Click OK


Four, install the Enhancement tool

Start the CentOS system in the virtual machine

Create a CDROM directory under the/MNT directory, which is/mnt/cdrom/, to mount the previous Vboxguestadditions.iso image to this directory

※ is not necessarily to be mounted to/mnt/cdrom, can be mounted to other directories

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/07/c3ebbd5f1558a6ef114602491892e38b.jpg-wh_500x0-wm_3 -wmp_4-s_494605755.jpg "title=" 6.jpg "alt=" C3ebbd5f1558a6ef114602491892e38b.jpg-wh_ "/>

[Email protected] mnt]# mount/dev/scd0/mnt/cdrom/

Mount:block Device/dev/sr0 is write-protected, mounting read-only

[Email protected] mnt]# CD cdrom/

[[email protected] cdrom]# ls

32Bit AUTORUN. INF cert runasroot.sh vboxsolarisadditions.pkg VBoxWindowsAdditions.exe

64Bit autorun.sh OS2 vboxlinuxadditions.run vboxwindowsadditions-amd64.exe Vboxwindowsadditions-x86.exe


Execute mount command: mount/dev/scd0/mnt/cdrom/

/dev/scd0 This is fixed, it refers to the Vboxguestadditions.iso file.

After mounting, you can go to/mnt/cdrom/below to see if there are any of these files shown in the figure, and if so, the mount succeeds.


After execution: Bash Vboxlinuxadditions.run

will start installing the enhancements (because my system has been installed before, this command is no longer executed)


If there is no information about the installation failure, it indicates that the installation was successful.


Five. Mount the shared folder

Switch to the root user to execute the following command

Mount-t vboxsf Share/home/ssspure/share

Vboxsf behind the share represents the first step to add the shared folder when the name of the shared folder, after the/home/ssspure/share this path can be decided by itself.

After the mount succeeds, CentOS can access the share folder in Windows by/home/ssspure/share this directory.

This article is from the "ssspure" blog, make sure to keep this source http://ssspure.blog.51cto.com/8624394/1979795

VirtualBox a shared folder with a Windows host under CentOS

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.