简体   繁体   中英

Can't vagrant up with rsync method on windows

I got the below errors once I run vagrant up and using rsync method in config type

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]

I found the solution from Google, when using the rsync method then add the ssh account to Vagrantfile content:

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

and remove lines from 77 ~ 79 at file C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-xxx\\plugins\\synced_folders\\sync\\helper.rb

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM