Files permissions are getting changed inside the guest host for shared folders.
Running
VirtualBox 4.3.12, controlling via Vagrant 1.6.3, on Windows 7 Pro SP1,
operating a guest of CentOS 6.5, all via MINGW32_NT-6.1 (inside
Atlassian SourceTree Shell).
From MINGW32 shell, example output of ls -al within a folder to be shared:
drwxr-xr-x 1 lon.bind Administ 4096 Aug 4 09:06 group_vars
-rw-r--r-- 1 lon.bind Administ 211 Jul 24 18:20 hosts.office
-rwxr-xr-x 1 lon.bind Administ 153 Jul 24 18:20 hosts.dev
-rwxr-xr-x 1 lon.bind Administ 153 Jul 24 18:20 hosts.lab
-rwxr-xr-x 1 lon.bind Administ 154 Jul 24 18:20 hosts.mgmt
Those are all exactly as they should be.
From within CentOS VM, same command from inside the shared folder:
drwxrwxrwx 1 root root 4096 Aug 4 13:06 group_vars
-rwxrwxrwx 1 root root 211 Jul 24 22:20 hosts.office
-rwxrwxrwx 1 root root 153 Jul 24 22:20 hosts.dev
-rwxrwxrwx 1 root root 153 Jul 24 22:20 hosts.lab
-rwxrwxrwx 1 root root 154 Jul 24 22:20 hosts.mgmt
Now everything is root and 777.
If
I change my config.vm.synced_folder mount_options I can alter the
owner, the group (same as if I change mount options in remounting the
shared folder). I can forceably override the file perms as well, using
either umask or fmode -- this makes all files the same. They should be
individually set as they originally are.
For example, can override like this:
config.vm.synced_folder VagrantUtil.src_code_dir(), "/opt/wp/app", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=777','fmode=770']
How do I get the permissions to remain as they are in the host?
Halp! Alvaro, save me :-)