Page 1 of 1

Recipe to set UID/GID on shared folder

Posted: 4. Aug 2024, 05:40
by JaeJ
My problem was that I wanted to mount a shared folder from the host, but with regular user UID/GID instead of root/vboxsf. I couldn't find a recipe on the web, so I wrote my own:
  • On the Host, setup the shared folder, e.g. named VBoxJJShare with automount off.
  • On the Client, create a directory to mount the shared folder on, e.g. mkdir /media/VBoxJJShare.
  • On the Client, add an appropriate entry to /etc/fstab:

    Code: Select all

    #<file system> <mount point>         <type>    <options>               <dump>  <pass>
    VBoxJJShare    /media/VBoxJJShare    vboxsf    uid=1000,gid=1000       0       0
    
After a reboot, the shared folder VBoxJJShare will be mounted on /media/VBoxJJShare with UID/GID of 1000/1000.
This allows me to login to share files as a normal user between my Host and my Guest Linux machines.