[Solved] file mode confusion with debian 9

Discussions about using Linux guests in VirtualBox.
Post Reply
bsmile
Posts: 27
Joined: 22. Oct 2017, 17:33

[Solved] file mode confusion with debian 9

Post 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!
Last edited by bsmile on 1. Dec 2017, 21:28, edited 2 times in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: file mode confusion with debian 9

Post 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
bsmile
Posts: 27
Joined: 22. Oct 2017, 17:33

Re: file mode confusion with debian 9

Post 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
Post Reply