Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

support for folder sync via rsync on windows. #67

Closed
wants to merge 2 commits into from

Conversation

databus23
Copy link
Contributor

rsync interprets paths with colons as remote locations.
This leads to "The source and destination cannot both be remote." erros when using local paths like c:\vagrant for the hostpath.
This commits converts the hostpath to /cygdrive/... notation on windows in general.
I confirmed that this works with the cwRsync Installer (https://www.itefix.no/i2/cwrsync).

rsync interprets paths with colons as remote locations.
This leads to "The source and destination cannot both be remote." erros when using local paths like c:\vagrant for the hostpath.
This commits converts the hostpath to /cygdrive/... notation on windows in general.
I confirmed that this works with the cwRsync Installer (https://www.itefix.no/i2/cwrsync).
@danrex
Copy link

danrex commented May 6, 2013

+1. I am running into the same problem. Please merge this pull request.

@artherd42
Copy link

I have the same problem. Please merge this pull request.

@EdJ
Copy link

EdJ commented May 18, 2013

Agreed, I'm also having rsync issues, so merging this in would be great.

@tknerr
Copy link
Contributor

tknerr commented Jun 3, 2013

From my experience there are two things you need to take care of in order to make it work on Windows:

  1. the rsync executable you have on windows is most likely cygwin-based (at least that's the only one which is compatible with the unix version I know of), thus expects the /cygdrive/... style pathnames. You mentioned cwrsync, personally I simply extracted rsync.exe and ssh.exe from the cygwin packages.
  2. one the path is corrected, you will run into an issue where the permissions are messed up and need to be set explicitly via --chmod=ugo=rwX

Both mccloud and knife-solo solve this issue (synced folders via rsync) in the same way and it has proven to work on windows:

edit: corrected link

@databus23
Copy link
Contributor Author

I have no special love for cwrsync. It comes as an installer and currently if you don't have cygwin installed its one of the easier ways to get it.
Obviously the best solution would be to have the vagrant installer ship the necessary files for rsync support on windows.
Your 2nd remark is interesting, I didn't run into those problems yet. I will look into it and update my pull request accordingly. Thanks!

In general I think rsync folder sync should be moved out of here and maintained somewhere central, probably as vagrant plugin or even as part of vagrant core. Looking at the other cloud providers (rackspace, digital ocean) this code was just copied and would be nice to fix them all at once.

@mitchellh Any thoughts on that and/or vendoring rsync in the vagrant windows installer?

@tknerr
Copy link
Contributor

tknerr commented Jun 3, 2013

@databus23 do you need the --chmod ugo=rwX fix as well with cwrsync?

I'm just wondering... personally I prefer the rsync.exe from the cygwin package as it's closer to the original and there's no need to install a GUI application. Oh wait, and it's free :-)

@tknerr
Copy link
Contributor

tknerr commented Jun 3, 2013

@databus23 fully agree, most providers will probably implement shared folders via rsync so it should be implemented once and for all in a more central place

👍 for vendoring the rsync and ssh executables

@tralamazza
Copy link
Collaborator

Thanks @databus23

@tralamazza tralamazza closed this Sep 27, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants