VirtualBox Shared folder permission Settings and usage methods

  • 2020-05-27 07:38:02
  • OfStack

VirtualBox Shared folder permission Settings and usage methods

Environment:
Host (host) : windowsXP
Virtual machine: VirtualBox
Client (guest) : slackware/ubuntu/...

Those of you who read my last post about installing additions for VirtualBox should be aware that you need to install VirtualBox Guest Additions before setting up the VirtualBox Shared folder. If you haven't, please refer to my last post.

Shared folders enable host wendows and client linux to share files with each other. In the current architecture, it is necessary to set a directory on the host windows to make a Shared directory. I took the sharedfolder directory of D disk as the Shared directory, and the path is D:/sharedfolder. Here's how to set up a Shared folder. Referring to the VirtualBox help documentation (in section 1 of virtual guest additions), I found that setting up a Shared folder can be done in the following steps.

1. Set a directory on the host windows as a Shared directory (there is no need to set the Shared property under windows, but it is also a common folder). (I set: D:/sharedfolder)

2. On virtual machine VirtualBox, if the virtual machine linux operating system is not started, go to Settings - > In the data space, specify D:/sharedfolder as the Shared folder, and specify the name that maps to linux. By default, it will be the same as your directory name, sharedfolder in this case. When the dialog box opens, you can see it clearly. If the virtual machine's linux operating system has been started on the device - > The same setup can be done in the allocated data space.

3. Open a console in the virtual machine and execute the following command under the authority of root:

#mkdir /mnt/share // create a directory to mount the Shared folder, of course you can create a directory anywhere.
Then run the command: mount-t vboxsf [-o OPTIONS] sharename mountpoint. sharename is the default name I mentioned above, sharedfolder, and mountpoint is where you want to mount the windows Shared folder on linux. What I'm using here is:

sudo can be used before root permission in #sudo mount-t vboxsf sharedfolder /mnt/share //ubuntu.

If you want the system to automatically mount the Shared folder at startup, you can add a record in /etc/fstab, as follows:

sudo pico /etc/fstab

Add 1 sentence:

sharedfolder /mnt/share vboxsf defaults 0 0

Save and exit, and when the system starts up it will automatically mount the folder to /mnt/share

Actually mounting this Shared folder is similar to mounting other devices 1.

Note that the command here is for the Linux client. The windows client USES a different command. You can refer to the VirtualBox help documentation.

4. This allows you to place the file under d:/sharedfolder on the windows host and see it in linux client /mnt/share.

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: