Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed Guest Additions on my Ubuntu 10.04 VM running out of VirtualBox in order to enable directory sharing, following these instructions. Set the shared folder in the VirtualBox GUI and it mounted it on the VM, where it appeared fine.

However, when I tried going into the shared directory on the VM (located in /media), I could not cd into it nor change ownership or permissions, the commands returning without an error but not actually having done their job:

mysuser@ubnt-xdev:/media$ ls -la
total 12
drwxr-xr-x  4 root root   4096 2013-08-28 11:34 .
drwxr-xr-x 22 root root   4096 2013-08-28 10:48 ..
drwxr-xr-x  2 root root   4096 2013-08-28 11:29 cdrom
drwxrwx---  1 root vboxsf   68 2013-08-28 11:19 sf_vmshare
mysuser@ubnt-xdev:/media$ cd sf_v*
-bash: cd: sf_vmshare: Permission denied
mysuser@ubnt-xdev:/media$ sudo chown mysuser sf_vmshare
[sudo] password for mysuser: 
mysuser@ubnt-xdev:/media$ ls -la sf_vmshare
drwxrwx---  1 root vboxsf   68 2013-08-28 11:19 sf_vmshare
mysuser@ubnt-xdev:/media$ sudo chgrp mysuser sf_vmshare
mysuser@ubnt-xdev:/media$ ls -la sf_vmshare
drwxrwx---  1 root vboxsf   68 2013-08-28 11:19 sf_vmshare
mysuser@ubnt-xdev:/media$ sudo chmod 777 sf_vmshare
mysuser@ubnt-xdev:/media$ ls -la sf_vmshare
drwxrwx---  1 root vboxsf   68 2013-08-28 11:19 sf_vmshare

Which makes the shared directory unusable. The directory works fine on the host. Anybody know what is going on?

share|improve this question

1 Answer 1

I figured it out, the user needs to be added to the vboxsf group:

sudo adduser mysuser vboxsf

Then restart the VM.

share|improve this answer
    
I think that you meant restart session or opening another login. –  Braiam Aug 28 '13 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.