Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
63
rated 0 times [  63] [ 0]  / answers: 1 / hits: 78750  / 2 Years ago, thu, august 25, 2022, 5:37:37

It is my first time using virtualbox and ubuntu (14.04), I am on a host Windows 7 OS.



I am trying to mount a shared folder that has files I need to access both in the virtualbox and on the windows OS. I have successfully mounted them using the vboxsf from the Guest Additions installed.



To mount I used the command sudo mount -t vboxsf <dir name in vbox> <directory in linux for example I used sudo mount -t vboxsf Test /home/user/Test



I found several ways of mounting the directories automatically upon startup using for example the /etc/rc.local method (here) where you modify said file appending the command to it (without sudo). Or by using the fstab method (here). I prefer the rc.local method personally.



Once mounted it has permissions dr-xr-xr-x however once mounted the directory is of root ownership and chown user /home/user/Test has no effect. This means I cannot make or change files in it as a normal user.



In the VirtualBox the directory to be shared is not set as read-only.



Is there a way to automatically mount the shared folder and assign ownership to my non root user?


More From » mount

 Answers
0

If you have the guest additions installed, use the VirtualBox menu:




Devices > Shared Folders...




Add the path, name and enable "Auto-mount" and "Make permanent" options.



Finally add your user to the group with:



sudo usermod -G vboxsf -a myusername


Logout and back again or reboot the machine to complete the process (thanks @Fo).



Groups are stored in /etc/group, according to the usermod man page.


[#24702] Friday, August 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bewre

Total Points: 164
Total Questions: 108
Total Answers: 106

Location: Ghana
Member since Sun, Mar 27, 2022
2 Years ago
bewre questions
Sun, May 14, 23, 13:27, 1 Year ago
Mon, Aug 2, 21, 03:57, 3 Years ago
Thu, Aug 26, 21, 18:05, 3 Years ago
Sat, Aug 6, 22, 21:41, 2 Years ago
Sat, Jul 24, 21, 22:52, 3 Years ago
;