LoginSignup
13
10

More than 5 years have passed since last update.

Windows + vagrant 1.8.5 + rsync 3.1.1 で発生する、config.vm.synced_folderの失敗の直し方

Last updated at Posted at 2016-02-12

概要

chocolateyで、virtualboxとvagrantとrsyncを普通にインストールしたら、vagrant up でsynced_folderのrsyncの同期で失敗します。
- Windows7, Windows8, Windows8.1, Windows10
- Vagrant 1.8.0+
- RSync for Windows 5.4.1.20150827

エラーメッセージと、各対応

rsync: change_dir "/c/path/to/project" failed: No such file or directory (2).

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\synced_folders\rsync\helper.rb の53行目あたりを、以下の様に編集してください。
「vagrant-1.8.5」の場所は、インストールしている Vagrant のバージョンによってかわります。適宜読み替えてください。

if Vagrant::Util::Platform.windows?
  # rsync for Windows expects cygwin style paths, always.
-  hostpath = Vagrant::Util::Platform.cygwin_path(hostpath)
+  hostpath = '/cygdrive' + Vagrant::Util::Platform.cygwin_path(hostpath)
end

参考: このissue(//github.com/mitchellh/vagrant/issues/3230)

mux_client_request_session: read from master failed: Connection reset by peerバグ修正済み

修正されたようです。(2016年7月29日 確認)1.8.5+では発生しません。

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.1\plugins\synced_folders\rsync\helper.rb の77行目あたりを、以下の様に編集してください。

rsh = [
  "ssh -p #{ssh_info[:port]} " +
  proxy_command +
-  "-o ControlMaster=auto " +
-  "-o ControlPath=#{controlpath} " +
-  "-o ControlPersist=10m " +
+  # "-o ControlMaster=auto " +
+  # "-o ControlPath=#{controlpath} " +
+  # "-o ControlPersist=10m " +
  "-o StrictHostKeyChecking=no " +
  "-o IdentitiesOnly=true " +
  "-o UserKnownHostsFile=/dev/null",
  ssh_info[:private_key_path].map { |p| "-i '#{p}'" },
].flatten.join(" ")

参考: このissue(//github.com/mitchellh/vagrant/issues/6702)

13
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
10