Rsync on windows - dup() in/out/err failed
Asked Answered
M

1

16

I am using Vagrant to manage virtual machines for developing purpose. My OS is Windows 10 and I am using Vagrant 1.9.1. Since default driver for folder syncing is slow i wanted to implement Rsync.

To to that I used Cygwin and installed Rsyn and OpenSSL.

When I run vagrant up inside Cygwin console I got this error:

There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /cygdrive/c/Users/User/my-project/my-project/
Guest path: /var/www
Command: "rsync" "--verbose" "--archive" "-z" "--chmod=ugo=rwX" "--no-perms" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL   -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i 'C:/Users/User/my-project/my-project/.vagrant/machines/gbb-my-project-sys-web-dev-1/virtualbox/private_key'" "--exclude" ".vagrant/" "--exclude" ".git/" "/cygdrive/c/Users/User/my-project/my-project/" "[email protected]:/var/www"
Error: dup() in/out/err failed
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

Commands I used to run vagrant

export VAGRANT_DETECTED_OS=cygwin
VAGRANT_HOME=/cygdrive/c/Users/User
export VAGRANT_HOME
vagrant up

Vagrant config:

synced_folder:
            vflsf_udtdv3aeexfs:
                owner: www-data
                group: www-data
                source: ./
                target: /var/www
                sync_type: rsync
                smb:
                    smb_host: ''
                    smb_username: ''
                    smb_password: ''
                    mount_options:
                        dir_mode: '0775'
                        file_mode: '0664'
                rsync:
                    args:
                        - '--verbose'
                        - '--archive'
                        - '-z'
                    exclude:
                        - .vagrant/
                        - .git/
                    auto: 'true'
Mitchelmitchell answered 23/5, 2017 at 11:7 Comment(2)
which box are you using ? and how do you run ssh on your windows machine (is it coming from cygwin or did you install separately like git-bash)Ilse
@FrédéricHenri It is CentOs 6 on VirtualBox. Also I have ssh bin added to windows environment PATH variable to run ssh connectionMitchelmitchell
M
5

Have you installed ssh via cygwin? If you have ssh from other sources (like, git for windows), it might be not compatible with rsync from cygwin.

Mouton answered 1/6, 2017 at 11:16 Comment(1)
I updated rsync on gurst machine and removed SSH from path enviromentMitchelmitchell

© 2022 - 2024 — McMap. All rights reserved.