Getting cwRsync to work with Vagrant on Windows 10 is a pain.
This tutorial is for people who have:
- Installed Vagrant
- Installed cwRsync Free Edition.
- Installed Git for Windows.
Reading comprehension 101:
cwRsync is a standalone version of rsync for Windows that doesn’t require Cygwin to be installed. I don’t have Cygwin installed because Git For Windows includes Git Bash and this is “good enough.” With a regular standalone cwRsync installation Cygwin will never be in the PATH and Vagrant will never add the required /cygdrive prefix.
Howto fix:
Add C:Program Files (x86)cwRsync
(or wherever you installed) to your path. To avoid problems make sure this string is placed before C:Program FilesGitcmd
and/or C:Program FilesGitmingw64bin;C:Program FilesGitusrbin
Add the following system variable: CYGWIN = nodosfilewarning
Edit (hack!)C:HashiCorpVagrantembeddedgemsgemsvagrant-1.7.4pluginssynced_foldersrsynchelper.rb
Change line ~43 from:
hostpath = Vagrant::Util::Platform.cygwin_path(hostpath)
To:
hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath)
Restart your shells to apply changes. Fiddle with your Vagrantfile. Tada!
Troubleshooting:
Git for Windows is based on MinGw. cwRsync is based on Cygwin. You cannot run Vagrant & cwRsync from Git Bash because cwRsync includes it’s own incompatible SSH binary. If you try you will get the following error:
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receive r=3.1.0]
Instead, when launching Vagrant use Microsoft PowerShell.