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?
Add your user to the vboxsf group:
sudo usermod -aG vboxsf $(whoami) sudo reboot
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.