30

My Setup is as follows -

Host: Ubuntu Server 14.04 Guest: Lubuntu Desktop 15.10

I have shared dirs on host to guest with automount option, and the directories show up in Guest OS's just fine - /media/sf_sharename

Also, the user of guest is added to vboxsf group.

The problem is that all the shared dir and its contents are owned by root. I have tried chown -R, but it finishes without reporting error wihtin guest but the ownership does not change.

I have another setup where guest is ubuntu desktop 15.10, and I did not face this problem there.

I need rw access on those shared dirs. How to fix this?

NRJ
  • 395
  • 1
  • 4
  • 11

4 Answers4

29

On Ubuntu Server host execute these commands :

sudo chmod -R 777 /path-to-shared-folder/shared-folder

sudo chown -R user1:user1 /path-to-shared-folder/shared-folder

On Lubuntu Desktop guest execute this command :

sudo usermod -G vboxsf -a user2

Restart the guest system for changes taking effect.

Note : user1 = your host user name | user2 = your guest user name

Frank N
  • 1,430
cl-netbox
  • 31,491
19

No need to change main group of user - add user into group is sufficient.

sudo adduser $USER vboxsf

After the command do a restart or logout and login.

Tharok
  • 334
14

It is not necessary to change the permissions on the host system, just easily mount the shared folder for the normal user:

sudo mount -t vboxsf folder share -o uid=1000,gid=1000

1000 is the default ID of the default user. This can be checked by id username

Jeno
  • 375
  • 3
  • 14
  • 28
2

On Ubunut 18.04 (and I thin same for 14) two question, because with proposals solutions, is not fine on too many scenarios such nginx and others.

  1. Add user to group vboxsf
  2. Add mount in /etc/fstab
  3. Verify that user has 1000 for uid and gid using id $USER
sudo usermod -aG vboxsf $USER

/etc/fstab

shared_named_in_virtual_box /home/user/point_mount_name vboxsf defaults,dmode=755,fmode=644,gid=1000,uid=1000 0 0

After reboot, if you put correct values, you have a shared mount on /home/user/point_mount_name with correct values, for chmod dirs and files, and chowned by your user.

abkrim
  • 362