aidanns / vagrant-reload

A plugin that allows you to reload a Vagrant plugin as a provisioning step.
MIT License
175 stars 37 forks source link

:reload step breaks during snapshot restore #15

Open tsirakisn opened 6 years ago

tsirakisn commented 6 years ago

Restoring a snapshot will attempt to re-provision a machine by default, and the reload trips the following error (post reload):

Vagrant cannot forward the specified ports on this VM, since they would collide with some other application that is already listening on these ports. The forwarded port to 3389 is already in use on the host machine.

To fix this, modify your current project's Vagrantfile to use another port. Example, where '1234' would be replaced by a unique host port:

config.vm.network :forwarded_port, guest: 3389, host: 1234

Sometimes, Vagrant will attempt to auto-correct this for you. In this case, Vagrant was unable to. This is usually because the guest machine is in a state which doesn't allow modifying port forwarding. You could try 'vagrant reload' (equivalent of running a halt followed by an up) so vagrant can attempt to auto-correct this upon booting. Be warned that any unsaved work might be lost.