Page 1 of 1

[Solved] file mode confusion with debian 9

Posted: 22. Oct 2017, 17:44
by bsmile
It seems the auto mounted shared directory is set to user root and group vboxsf, I tried to change the user to be myself but failed. The confusions are

(1) root is not in vboxsf, but it is shown so for the shared directory
(2) I add myself into vboxsf, but chmod does not have effect on changing the priviledge
(3) I should have installed guest addition correctly, but don't know how to check it.

Code: Select all

ls -lat /media
drwxrwx---  1 root vboxsf    0 Sep 18 23:35 sf_debian_xfce

john@debian:/media$ grep vboxsf /etc/group
vboxsf:x:999:john

root@debian:/media# chmod 754 sf_debian_xfce
root@debian:/media# ls -la
drwxrwx---  1 root vboxsf    0 Sep 18 23:35 sf_debian_xfce
any place I did wrong? thanks for help!

Re: file mode confusion with debian 9

Posted: 22. Oct 2017, 18:15
by Perryg
Auto mount uses the share as removable media and the OS controls the permission level at that level. I don't use auto mount for just that reason. Instead I use a manual mount with rw option plus uid/gid entries and then mount the share after boot usually in /etc/rc.local. Keep in mind some Debian builds need a sleep statement to make sure that the additions are actually running to prevent failure.

Example: /etc/rc.local

Code: Select all

# By default this script does nothing.

#Add sleep to allow to work on fast boot OSes

sleep 10 && mount -t  vboxsf -o rw,uid=1000,gid=1000 Transfer /mnt/Transfer &
sleep 10 && mount -t vboxsf -o rw,uid=1000,gid=1000 Public /mnt/Public &

exit 0

Re: file mode confusion with debian 9

Posted: 1. Dec 2017, 21:28
by bsmile
this question appeared at early time of playing with virtualbox, and I don't quite understand the question myself as I review it now. I guess the question is actually I mounted a folder to a virtual machine, but it cannot be accessed. Under linux mint, it can be resolved as the following

sudo adduser youruser vboxsf
shutdown -r now