[Solved] file mode confusion with debian 9

Discussions about using Linux guests in VirtualBox.

[Solved] file mode confusion with debian 9

Postby bsmile » 22. Oct 2017, 17:44

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   Expand viewCollapse view
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.
bsmile
 
Posts: 13
Joined: 22. Oct 2017, 17:33

Re: file mode confusion with debian 9

Postby Perryg » 22. Oct 2017, 18:15

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   Expand viewCollapse view
# 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
Perryg
Site Moderator
 
Posts: 34266
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

Postby bsmile » 1. Dec 2017, 21:28

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


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 20 guests