1

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?

AviG
  • 133

1 Answers1

3

In your specific scenario, simply trying to change folder owner won't work. This is what has worked for me:

  1. Create a shared folder SHARED (Host-side), from a local (Guest-side) path /folder/path/, give it full access and uncheck automount option in VirtualBox
  2. Run sudo usermod -aG vboxsf yourusername on the Guest
  3. Take note of your userid; run cat /etc/passwd|grep yourusername from the Guest to find it (it usually is 1000)
  4. Edit /etc/fstab to add mount point to it: SHARED /folder/path/ vboxsf defaults,dmode=755,fmode=644,gid=1000,uid=1000 0 0 on the Guest, replacing gid and uid with previous userid
  5. Reboot the Guest
abkrim
  • 362