Re: Init script for Vagrant

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Init script for Vagrant

Karl Oskar Mattsson
I'm using this upstart script:

description "vagrant service"
author "KO"
start on desktop-session-start
stop on desktop-shutdown
console output
respawn
respawn limit 5 10

pre-stop script
su <user> -c "vboxmanage controlvm <uuid> savestate"
end script

exec su <user> -c "vboxmanage startvm <uuid> --type headless"

The uuid can be found in a .vagrant file in your Vagrant folder. Put the file in /etc/init/something.conf

I'm actually not sure whether the machine saves it state but the whole setup has worked as expected for some time.

/KO

On Tuesday, December 11, 2012 9:43:08 AM UTC+1, Thomas wrote:
Is there any init script sample available for starting up (and stopping) virtual machines automatically during boot on Linux? (Ubuntu in my case)
I did dig around already without success.

Thanks
Thomas

--