diff --git a/plugins/synced_folders/rsync/helper.rb b/plugins/synced_folders/rsync/helper.rb index 9763d77eb..594410436 100644 --- a/plugins/synced_folders/rsync/helper.rb +++ b/plugins/synced_folders/rsync/helper.rb @@ -98,8 +98,12 @@ module VagrantPlugins args << "--no-group" unless args.include?("--group") || args.include?("-g") # Tell local rsync how to invoke remote rsync with sudo - if machine.guest.capability?(:rsync_command) - args << "--rsync-path"<< machine.guest.capability(:rsync_command) + rsync_path = opts[:rsync_path] + if !rsync_path && machine.guest.capability?(:rsync_command) + rsync_path = machine.guest.capability(:rsync_command) + end + if rsync_path + args << "--rsync-path"<< rsync_path end # Build up the actual command to execute @@ -132,9 +136,10 @@ module VagrantPlugins end if opts.include?(:verbose) - command_opts[:notify] = [ :stdout, :stderr ]; - r = Vagrant::Util::Subprocess.execute(*(command + [command_opts])) { - |io_name,data| data.each_line { |line| machine.ui.info("rsync[#{io_name}] -> #{line}") } + command_opts[:notify] = [:stdout, :stderr] + r = Vagrant::Util::Subprocess.execute(*(command + [command_opts])) { + |io_name,data| data.each_line { |line| + machine.ui.info("rsync[#{io_name}] -> #{line}") } } else r = Vagrant::Util::Subprocess.execute(*(command + [command_opts])) diff --git a/website/docs/source/v2/synced-folders/rsync.html.md b/website/docs/source/v2/synced-folders/rsync.html.md index 6281dc07a..656731c96 100644 --- a/website/docs/source/v2/synced-folders/rsync.html.md +++ b/website/docs/source/v2/synced-folders/rsync.html.md @@ -62,9 +62,13 @@ The rsync synced folder type accepts the following options: pattern. By default, the ".vagrant/" directory is excluded. We recommend excluding revision control directories such as ".git/" as well. +* `rsync__rsync_path` (string) - The path on the remote host where rsync + is and how it is executed. This is platform specific but defaults to + "sudo rsync" for many guests. + * `rsync__verbose` (boolean) - If true, then the output from the rsync process will be echoed to the console. The output of rsync is subject - to rsync__args of course. By default, this is false. + to `rsync__args` of course. By default, this is false. ## Example