diff --git a/website/docs/source/v2/synced-folders/rsync.html.md b/website/docs/source/v2/synced-folders/rsync.html.md index 7393baa9a..62e88d0dd 100644 --- a/website/docs/source/v2/synced-folders/rsync.html.md +++ b/website/docs/source/v2/synced-folders/rsync.html.md @@ -35,6 +35,10 @@ can automatically install rsync into many operating systems. If Vagrant is unable to automatically install rsync for your operating system, it will tell you. +The destination folder will be created as the user initiating the connection, +this is `vagrant` by default. This user requires the appropiate permissions on +the destination folder. + ## Options The rsync synced folder type accepts the following options: @@ -68,3 +72,16 @@ Vagrant.configure("2") do |config| rsync__exclude: ".git/" end + +## Rsync to a restricted folder + +If required to copy to a destination where `vagrant` user doesn't have +permissions, use `"--rsync-path='sudo rsync'"` to run rsync with sudo on the guest + +
+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
+