When using RSync as a synced folder option in Vagrant, it's a slightly more complex setup. RSync can be used when other options for file-syncing are not available, such as the other option we have looked at, basic usage, or in the next section, which is the NFS option.
To start using RSync, our Vagrant file just needs an extra parameter on the config.vm.synced_folders option:
config.vm.synced_folder ".", "/home/vagrant/files", type: "rsync"
There are additional parameters available to use with the RSync option. Please view the official documentation for the most up-to-date list. These include the ability to exclude certain files.
RSync traditionally does a one-time sync from the host to guest machine unless the rsync_auto option is set to true in the Vagrantfile. This is the default value in Vagrant, but can be changed by setting the rsync_auto option to false.