{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/5263","labels_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5263/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5263/comments","events_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5263/events","html_url":"https://github.com/mitchellh/vagrant/issues/5263","id":55887972,"number":5263,"title":"Rsync synced_folder does not detect a port collision with config.ssh.port, uses old port ","user":{"login":"deancsmith","id":387289,"avatar_url":"https://avatars.githubusercontent.com/u/387289?v=3","gravatar_id":"","url":"https://api.github.com/users/deancsmith","html_url":"https://github.com/deancsmith","followers_url":"https://api.github.com/users/deancsmith/followers","following_url":"https://api.github.com/users/deancsmith/following{/other_user}","gists_url":"https://api.github.com/users/deancsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/deancsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deancsmith/subscriptions","organizations_url":"https://api.github.com/users/deancsmith/orgs","repos_url":"https://api.github.com/users/deancsmith/repos","events_url":"https://api.github.com/users/deancsmith/events{/privacy}","received_events_url":"https://api.github.com/users/deancsmith/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitchellh/vagrant/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/mitchellh/vagrant/labels/synced-folders/rsync","name":"synced-folders/rsync","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mitchellh/vagrant/milestones/11","html_url":"https://github.com/mitchellh/vagrant/milestones/1.8","labels_url":"https://api.github.com/repos/mitchellh/vagrant/milestones/11/labels","id":1193688,"number":11,"title":"1.8","description":"","creator":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars.githubusercontent.com/u/408570?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":56,"state":"open","created_at":"2015-07-05T16:04:07Z","updated_at":"2015-11-20T18:32:08Z","due_on":"2015-11-30T08:00:00Z","closed_at":null},"comments":1,"created_at":"2015-01-29T11:32:10Z","updated_at":"2015-11-20T18:32:08Z","closed_at":"2015-11-20T18:32:08Z","body":"The rsync synced_folder type does not seem to be detecting when there is a port collision on the SSH port and Vagrant has automatically changed the port. E.g. I run several VMs where the Vagrantfile has:\r\n\r\n> config.ssh.port = 2222\r\n\r\nIf I have one VM running, and then bring up another, then Vagrant changes the SSH port on the second VM to 2202, but then the rsync command still connects to port 2222, overwriting the data on the first VM, rather than the second.\r\n\r\nThe below is running Vagrant 1.7.1 on OS X with Windows 2008R2 guests.\r\n\r\nMy rsync configuration in the Vagrantfile is:\r\n\r\n> config.vm.synced_folder \".\", \"/cygdrive/c/inetpub/wwwroot/\", type: \"rsync\", rsync__exclude: [\".git/\",\"vendor/*\", \".idea/\"]\r\n\r\nHere is the relevant portion of *vagrant up* on the second machine.\r\n\r\n```\r\n==> default: Fixed port collision for 5985 => 55985. Now on port 2201.\r\n==> default: Fixed port collision for 22 => 2222. Now on port 2202.\r\n==> default: Clearing any previously set network interfaces...\r\n==> default: Preparing network interfaces based on configuration...\r\n    default: Adapter 1: nat\r\n    default: Adapter 2: hostonly\r\n==> default: Forwarding ports...\r\n    default: 3389 => 2278 (adapter 1)\r\n    default: 5985 => 4875 (adapter 1)\r\n    default: 389 => 1287 (adapter 1)\r\n    default: 5985 => 2201 (adapter 1)\r\n    default: 22 => 2202 (adapter 1)\r\n==> default: Running 'pre-boot' VM customizations...\r\n==> default: Booting VM...\r\n==> default: Waiting for machine to boot. This may take a few minutes...\r\n==> default: Machine booted and ready!\r\n==> default: Checking for guest additions in VM...\r\n==> default: Configuring and enabling network interfaces...\r\n==> default: Rsyncing folder: /Users/dean/PhpstormProjects/foo/ => /cygdrive/c/inetpub/wwwroot\r\n==> default:   - Exclude: [\".vagrant/\", \".git/\", \"vendor/*\", \".idea/\"]\r\n==> default: Mounting shared folders...\r\n```\r\n\r\nThis is the rsync command as shown by *vagrant rsync --debug*.\r\n\r\n```\r\nDEBUG guest: Searching for cap: rsync_pre\r\nDEBUG guest: Checking in: windows\r\n INFO subprocess: Starting process: [\"/usr/bin/rsync\", \"--verbose\", \"--archive\", \"--delete\", \"-z\", \"--copy-links\", \"--no-owner\", \"--no-group\", \"-e\", \"ssh -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/Users/dean/PhpstormProjects/foo/id_rsa'\", \"--exclude\", \".vagrant/\", \"--exclude\", \".git/\", \"--exclude\", \"vendor/*\", \"--exclude\", \".idea/\", \"/Users/dean/PhpstormProjects/foo/\", \"vagrant@127.0.0.1:/cygdrive/c/inetpub/wwwroot\"]\r\nDEBUG subprocess: Command not in installer, not touching env vars.\r\nDEBUG subprocess: Selecting on IO\r\nDEBUG subprocess: stderr: Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.\r\nDEBUG subprocess: stdout: building file list ...\r\nDEBUG subprocess: stdout: done\r\n```\r\n\r\nAs a workaround I plan to just change each project to use a different *config.ssh.port* value."},"comment":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/comments/158484144","html_url":"https://github.com/mitchellh/vagrant/issues/5263#issuecomment-158484144","issue_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5263","id":158484144,"user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T18:32:08Z","updated_at":"2015-11-20T18:32:08Z","body":"I believe this has been fixed recently. I can't reproduce this anymore."}}