Ubuntu Linux server - set file permissions for VirtualBox shared folder

wowpatrick

I have Ubuntu server with Apache 2, PHP, and various DBMSs running in VirtualBox on my Mac host for my web development work. To easily create/edit the files I'm working on, I mounted a directory from my Mac host via the VirtualBox shared directory feature to /var/www/. Every file I create on my Mac host has the following permissions on the on the Server: -rw-r--r-- 1 root root 6 2011-07-30 01:27 test.

The problem is that most PHP scripts/frameworks/etc. need write access to some files. It is extremely annoying to have to chmod every new file/directory that needs write access. Is there a way to set the correct permissions for the files/directories automatically?

kerdany

You can set some mounting options while mounting your the shared folder on the guest OS - here are the available options:

http://manpages.ubuntu.com/manpages/maverick/man8/mount.vboxsf.8.html

There are many solutions to your problem:

  • To make the files seen as owned by your VirtualBox user's uid and gid (using the uid and gid mounting options).

  • To override the mode of all files/directories using dmode and fmode options.

  • To change the umask on your host to a less restrictive mask.

I usually prefer the first option. In your case the entry to the /etc/fstab file should look like this:

dev /var/www vboxsf umask=0022,gid=33,uid=33

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Ubuntu Desktop 18 virtualbox unable to change file permissions of shared folder

From Java

Virtualbox shared folder permissions

From Dev

Virtualbox Ubuntu Server, host shared folder... where is it?

From Dev

Shared folder Virtualbox Ubuntu / Lubuntu

From Dev

Ubuntu File and folder permissions

From Dev

Linux folder and file permissions

From Dev

Linux File / Folder permissions

From Dev

Shared folder shows different permissions between Windows host and Ubuntu guest when using VirtualBox

From Dev

How do I set the Apache2 DocumentRoot to a "vboxsf" VirtualBox Shared Folder? (permissions issue?)

From Dev

Shared folder in VirtualBox (Ubuntu and Windows 7)

From Dev

How to access a shared folder with Ubuntu on VirtualBox

From Dev

Change group permissions on linux shared folder

From Dev

Need to automate file transfer from linux server to windows shared folder

From Dev

Strategy for File System Permissions On KVM Shared Folder

From Dev

Learning about File Permissions with a shared group folder

From Dev

Virtualbox accessing HTML file on shared folder

From Dev

VirtualBox in Linux: same virtual machine in a shared folder result in file not accesible every time an user saves the state of the machine

From Dev

Linux Ubuntu 14.04.1 File Permissions

From Dev

VirtualBox shared folder headless

From Dev

Virtualbox: Mount a shared folder in Guest FreeBSD from Host Ubuntu

From Dev

Virtualbox: Mount a shared folder in Guest FreeBSD from Host Ubuntu

From Dev

IIS in VirtualBox serving files from shared Ubuntu folder

From Dev

Create a shared folder between Mac(Host) and Ubuntu(GUEST) on virtualbox

From Dev

VirtualBox Shared Folder Windows 10 Host, Ubuntu Guest

From Dev

How do I set permissions on a network-shared folder?

From Dev

How do I set permissions on a network-shared folder?

From Dev

Recover files under a shared folder deleted by a guest Linux in VirtualBox

From Dev

Can't make files hidden on shared folder Linux VirtualBox

From Dev

Setup FreeDOS in VirtualBox to access shared folder on Novell Server

Related Related

  1. 1

    Ubuntu Desktop 18 virtualbox unable to change file permissions of shared folder

  2. 2

    Virtualbox shared folder permissions

  3. 3

    Virtualbox Ubuntu Server, host shared folder... where is it?

  4. 4

    Shared folder Virtualbox Ubuntu / Lubuntu

  5. 5

    Ubuntu File and folder permissions

  6. 6

    Linux folder and file permissions

  7. 7

    Linux File / Folder permissions

  8. 8

    Shared folder shows different permissions between Windows host and Ubuntu guest when using VirtualBox

  9. 9

    How do I set the Apache2 DocumentRoot to a "vboxsf" VirtualBox Shared Folder? (permissions issue?)

  10. 10

    Shared folder in VirtualBox (Ubuntu and Windows 7)

  11. 11

    How to access a shared folder with Ubuntu on VirtualBox

  12. 12

    Change group permissions on linux shared folder

  13. 13

    Need to automate file transfer from linux server to windows shared folder

  14. 14

    Strategy for File System Permissions On KVM Shared Folder

  15. 15

    Learning about File Permissions with a shared group folder

  16. 16

    Virtualbox accessing HTML file on shared folder

  17. 17

    VirtualBox in Linux: same virtual machine in a shared folder result in file not accesible every time an user saves the state of the machine

  18. 18

    Linux Ubuntu 14.04.1 File Permissions

  19. 19

    VirtualBox shared folder headless

  20. 20

    Virtualbox: Mount a shared folder in Guest FreeBSD from Host Ubuntu

  21. 21

    Virtualbox: Mount a shared folder in Guest FreeBSD from Host Ubuntu

  22. 22

    IIS in VirtualBox serving files from shared Ubuntu folder

  23. 23

    Create a shared folder between Mac(Host) and Ubuntu(GUEST) on virtualbox

  24. 24

    VirtualBox Shared Folder Windows 10 Host, Ubuntu Guest

  25. 25

    How do I set permissions on a network-shared folder?

  26. 26

    How do I set permissions on a network-shared folder?

  27. 27

    Recover files under a shared folder deleted by a guest Linux in VirtualBox

  28. 28

    Can't make files hidden on shared folder Linux VirtualBox

  29. 29

    Setup FreeDOS in VirtualBox to access shared folder on Novell Server

HotTag

Archive