I am using a VM with Ubuntu 18.04 with GUI, and I am working on a Wordpress project with Nginx. I installed VBox guest additions, but I cannot change the owner of the shared folder, which I have set to auto mount in the /opt folder; the path to the shared folder is /opt/myfolder/THISFOLDER. I want to edit contents (files) inside THISFOLDER. I have tried the command sudo chmod -aG vboxsf myusername and rebooted to no avail. When I do sudo chown -R myusername /opt/myfolder, it also doesn't do anything. How can I fix this?
Asked
Active
Viewed 5,879 times
1
Organic Marble
- 24,696
AviG
- 133
1 Answers
3
In your specific scenario, simply trying to change folder owner won't work. This is what has worked for me:
- Create a shared folder
SHARED(Host-side), from a local (Guest-side) path/folder/path/, give it full access and uncheckautomountoption in VirtualBox - Run
sudo usermod -aG vboxsf yourusernameon the Guest - Take note of your userid; run
cat /etc/passwd|grep yourusernamefrom the Guest to find it (it usually is 1000) - Edit
/etc/fstabto add mount point to it:SHARED /folder/path/ vboxsf defaults,dmode=755,fmode=644,gid=1000,uid=1000 0 0on the Guest, replacinggidanduidwith previous userid - Reboot the Guest
Gui Imamura
- 355
abkrim
- 362