Changing Vagrant's Default SSH Port To Prevent Collision When Resuming a Suspended Instance


When you are running multiple Vagrant instances you often find you are unable to resume a suspended vm instance because the port forwarding clashes with another running Vagrant box

Solution (Updated 04/09/2015)

 Assign each Vagrant instance a unique port in the Vagrantfile. :private_network, ip: '' :forwarded_port, guest: 22, host: 12914, id: 'ssh'

Setting the id: to 'ssh' overwrites the default mapping. In previous version, you had to explicitly disable the default port first else both would be created and you'd still clash but in current versions the cleaner single line works as expected. :private_network, ip: "" :forwarded_port, guest: 22, host: 2222, id: "ssh", disabled: true :forwarded_port, guest: 22, host: 64673, auto_correct: true

There is discussion of this at where I got the origional solution.