Getting cwRsync to work with Vagrant on Windows 10 is a pain.
This tutorial is for people who have:
- Installed Vagrant (Currently 1.7.4)
- Installed cwRsync Free Edition. (Currently 5.4.1)
- Installed Git for Windows. (Currently 2.5.3)
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.
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
Change line ~43 from:
hostpath = Vagrant::Util::Platform.cygwin_path(hostpath)
hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath)
Restart your shells to apply changes. Fiddle with your Vagrantfile. Tada!
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.