Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On my laptop I have got installed Ubuntu 11.04 and VirtualBox with Ubuntu Server 12.10. I have shared folder in /home/szymon/projekty_www. I can see content of this folder in virtual machine in /media/sf_projekty_www, but sadly I need root permision.

When I do:

root@ubuntu-server:/media# ls -l

I get answer:

drwxr-xr-x 2 root root   4096 cze  7 08:54 cdrom
drwxrwx--- 1 root vboxsf 4096 cze  7 14:38 sf_projekty_www

Of course I tried to change permissions:

sudo chmod a+rwx /media/sf_projekty_www

but it does nothing. The permissions are the same:

drwxr-xr-x 2 root root   4096 cze  7 08:54 cdrom
drwxrwx--- 1 root vboxsf 4096 cze  7 14:38 sf_projekty_www

What should I do?

share|improve this question

migrated from stackoverflow.com Jun 7 '13 at 18:19

This question came from our site for professional and enthusiast programmers.

    
Is it mounted read/write, or read only? Can you use sudo to get root permission? –  Peter L. Jun 7 '13 at 17:02

1 Answer 1

up vote 1 down vote accepted

That directory sf_... is mounted by VirtualBox with type vboxsf (ie all operations managed by vbox). You cannot change easily owner or access rights.

The recommend way to allow a user to access the directory is to make that user a member of the group vboxsf. To make myuser a member of that group:

$ sudo usermod -G vboxsf -a myuser

Restart the Virtual machine, then myuser should have access to the sf directory.

(See also comment below)

share|improve this answer
    
Actually, you don't need to restart - just log that user out and back in again, possibly even on a per-shell (window) basis. –  Chris Stratton Jun 7 '13 at 17:30

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.