Re: Restart VM during Vagrant provisioning

1,838 views
Skip to first unread message

wenlock

unread,
Apr 15, 2013, 2:48:43 PM4/15/13
to vagra...@googlegroups.com
I had the same problem when implementing host_name change on cygwin guest.   Best answer I was able to find then was:

vm.action("reload")

I'm not sure how to get a vm object out of env object though.

I'd be interested in finding out if there is a good solution for that.

Thanks,
Edward

On Saturday, April 13, 2013 8:51:16 AM UTC-7, Firen Firen wrote:
Hi,
I am trying to setup vagrant + chef configuration. One of provisioning actions requires me to change locales on the server. When I change locales I must restart VM or relogin to that take effect. Any idea if it is possible in Vagrant?

Emmanuel Pirsch

unread,
Oct 1, 2013, 11:30:34 AM10/1/13
to vagra...@googlegroups.com
Here is a solution that I'm using.

This allows you to add 
config.vm.provision :reboot
to reboot

Simple and effective. It just reboot the VM, wait for it to reboot and remount shared folders.

This is for Windows VM but you can adapt it easily for other OSes.

This works with the VirtualBox provider. Again, it shouldn't be to hard to adapt it for other providers.
Reply all
Reply to author
Forward
0 new messages