Skip to main content

Vagrant Rsync Folders on a Windows host

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· One min read
Stephan Hochdörfer

Since quite a while Vagrant has support for syncing folders via rsync. While it is quite easy to set things up on a linux box, I was struggling a bit to get things going on a windows host. As the vagrant docs recommended I installed rsync and ssh client via the Cygwin package. After running "vagrant up" I got an error from the Vagrant rsync plugin stating "No such file or directory". Via Google search I came across a bug report on Github. As it turns out the problem seems to occur because Vagrant "tries to be smart and detect the environment but it obviously doesn't work reliably". The proposed solution is to patch the Vagrant ruby sources. You have to edit the file C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\plugins\synced_folders\rsync\helper.rb and change line 43 to:

hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath)