无法在Windows上使用rsync方法进行流浪

时间:2016-03-27 19:02:30

标签: windows vagrant

一旦我运行vagrant并在配置类型

中使用rsync方法,我得到了以下错误
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /e/virtual-boxes/scotchbox/
Guest path: /var/www
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'E:/virtual-boxes/scotchbox/.vagrant/machines/default/virtualbox/private_key' --exclude .vagrant/ --exclude .git/ /e/virtual-boxes/scotchbox/ vagrant@127.0.0.1:/var/www
Error: Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
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]

1 个答案:

答案 0 :(得分:1)

我在使用rsync方法时找到了谷歌的解决方案,然后将ssh帐户添加到Vagrantfile内容中:

config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
config.vm.synced_folder ".", "/var/www", type: "rsync", rsync__exclude: ".git/"

并从文件C中删除77~79行:\ HashiCorp \ Vagrant \ embedded \ gems \ gems \ vagrant-xxx \ plugins \ synced_folders \ sync \ helper.rb

"-o ControlMaster=auto " +
"-o ControlPath=#{controlpath} " +
"-o ControlPersist=10m " +