How do I reboot a Vagrant guest from a provisioner?

If you only want to reboot after provisioning is complete (not between provisioning steps), you can use a trigger to achieve this:

config.trigger.after [:provision] do |t|
  t.name = "Reboot after provisioning"
  t.run = { :inline => "vagrant reload" }
end

This has the advantage of not requiring a plugin to be installed.

More information on triggers here.


This is exactly what the vagrant-reload plugin is for. After installing it simply add config.vm.provision :reload at the point in the provisioning you want to reload.