Directory Permission Change Not Working

10,516

Solution 1

As the directory is shared by the host, the permission change should be applied on the host system (Mac) not the guest (Ubuntu) where the folder is mounted. The method of adding the user to the group vboxsf won't work in this special case I think because the Mac won't know about the Ubuntu user so the chmod 777 (rwxrwxrwx) is the way to go.

Solution 2

I know it's not quite answering the question as asked, but from the looks of things, adding any users which need that access to group "vboxsf" might actually be the better way to go. The command:

usermod -aG vboxsf user

should do the trick, assuming the user you want to give access to is named "user". After that, try writing to the directory as the user. I think it should work.

Share:
10,516

Related videos on Youtube

GChorn
Author by

GChorn

Python, Django, HTML, CSS and JS novice.

Updated on September 18, 2022

Comments

  • GChorn
    GChorn over 1 year

    I'm sure I'm missing something quite basic here, but I'm running Ubuntu through Virtual Box on my Mac, and so I need to give my Ubuntu user read/write access to the folder shared by the host and guest systems (named sf_VB_Shared_Folder). I performed and got the following:

    user@user-VirtualBox:/media$ ls -l
    total 0
    drwxrwx--- 1 root vboxsf 68 Aug  3 07:59 sf_VB_Shared_Folder
    user@user-VirtualBox:/media$ sudo chmod ugo+rwx sf_VB_Shared_Folder 
    user@user-VirtualBox:/media$ ls -l
    total 0
    drwxrwx--- 1 root vboxsf 68 Aug  3 07:59 sf_VB_Shared_Folder
    

    Why are the permissions not changing?

  • GChorn
    GChorn almost 12 years
    I tried your command without sudo and got usermod: cannot lock /etc/passwd; try again later. Then I tried with sudo, didn't get any errors, but when I try to cd into the directory I still get bash: cd: sf_VB_Shared_Folder: Permission denied.
  • laurent
    laurent almost 12 years
    you need to log out and log in for the new group attribution to take effect.
  • GChorn
    GChorn almost 12 years
    THANKS!!! chmod 777 from the Mac terminal worked like a charm.
  • lrepolho
    lrepolho over 9 years
    It worked like a charm, tks. In my case i used it to grant permission to puppet user