Vagrant shared folder and rsync do not set the right permition

522 views
Skip to first unread message

Tommy Eriksen

unread,
Feb 26, 2015, 6:12:41 PM2/26/15
to vagra...@googlegroups.com
I have this in my vagrant file

config.vm.synced_folder "html/", "/var/www/html/current", type: "rsync", owner: "vagrant", group: "vagrant", rsync__exclude: [".git/", "var/", "/media"], rsync__auto: true

This sync manage to sync the files for me BUT the permitions for the files on the remote directory is root.root I am not able to set other users at all. I have seen so many examples and it should be easy but not for me :(

I have allso tried to set --owner and --group in the rsync args but that din not work.

I have tested on windows with cygwin and Mac, same issue on both. Any idea?

I have the latest vagrant installed.

Alvaro Miranda Aguilera

unread,
Feb 26, 2015, 9:53:17 PM2/26/15
to vagra...@googlegroups.com
On Fri, Feb 27, 2015 at 12:12 PM, Tommy Eriksen <cakem...@gmail.com> wrote:
> owner: "vagrant", group: "vagrant"

Hello,

check the end of this:

http://docs.vagrantup.com/v2/synced-folders/rsync.html

You can use something like this:

Vagrant.configure("2") do |config|
config.vm.synced_folder "bin", "/usr/local/bin", type: "rsync",
rsync__exclude: ".git/",
rsync__args: ["--verbose", "--rsync-path='sudo rsync'",
"--archive", "--delete", "-z"]
end

Tommy Eriksen

unread,
Feb 27, 2015, 3:18:55 AM2/27/15
to vagra...@googlegroups.com
Thanks for the answer.
I tried to use this code in the vagrant file. It seems the exlude works but still all the synced files get root.root as user and group.


  config.vm.synced_folder "html/", "/var/www/html/current",
  type: "rsync",
  owner: "vagrant", group: "vagrant",
  rsync__exclude: [".git/", "var/", "/media"],
  rsync__args: ["--verbose", "--rsync-path='sudo rsync'", "--archive", "--delete", "-z"],
  rsync__auto: "true"

Is it possible to debug vagrant with logs?

Alvaro Miranda Aguilera

unread,
Mar 1, 2015, 5:25:43 PM3/1/15
to vagra...@googlegroups.com
Can you try to put this on true. Should be true by default, but if not
working you can try to force it

rsync__chown (boolean) - If false, then the owner and group options
for the synced folder are ignored and Vagrant won't execute a
recursive chown. This defaults to true. This option exists because the
chown causes issues for some development environments. Note that any
rsync__args options for ownership will be overridden by rsync__chown.

if still doesn't work, please do this:

vagrant halt
VAGRANT_LOG=debug vagrant up | tee vagrant_up.log

and share a gist of the log and a sample Vagrantfile to reproduce the issue.

Alvaro.
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages