5

I've created a shared folder in VirtualBox and made it mount under Ubuntu; I see it in the /media/ dir, but when I'm trying to list it I'm getting a "No permission" error message. How can I fix that?

  • See https://askubuntu.com/questions/252853/how-to-mount-a-virtualbox-shared-folder-at-startup and https://askubuntu.com/questions/30396/error-mounting-virtualbox-shared-folders-in-an-ubuntu-guest for more on accessing shared folders. – Takkat Aug 09 '15 at 15:26

4 Answers4

8

Add your user to the vboxsf group:

sudo usermod -aG vboxsf $(whoami)
sudo reboot
Katu
  • 3,593
  • 26
  • 42
1

By default Virtual Box shared folders are created with read/write permission for the guest. This can be done from the command line with:

VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"

By adding the option --readonly we can restrict these for read only access. Use the --transient option if you only want the shares to appear in the present session but not persistent for follwing sessions. There are some limitations for shared folders (see this question for details). If prerequisites are met we may mount these shared folders manually by running the following commands in the guest:

mkdir /home/<user>/vboxshare
sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/<user>/vboxshare

Of course we can also use different mount options to mount as read/only or mount with read access only to root.

Prashant Chikhalkar
  • 2,411
  • 2
  • 18
  • 25
0

Open your Virtual Machine's Terminal. Type sudo su then enter your password.

Write the following commands

sudo usermod -a -G vboxsf your_account_name

sudo chown -R your_account_name:users /media/your_share_folder_name/

Example sudo usermod -a -G vboxsf mir

Example sudo chown -R mir:users /media/sf_Shared_folder/

Now reboot your Virtual Machine and check the shared folder again

Mir Rahed Uddin
  • 619
  • 1
  • 8
  • 20
0

Please make sure you have the same version of Virtualbox Guest Additions installed on the Guest machine as of Virtualbox on Host machine.