Skip to content

Instantly share code, notes, and snippets.

@narkisr
Created July 31, 2012 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save narkisr/3221727 to your computer and use it in GitHub Desktop.
Save narkisr/3221727 to your computer and use it in GitHub Desktop.
Loading phpvirtualbox and vms on boot using upstart
#/etc/init.d/vboxdrv, add to the end of the start function
/sbin/initctl emit vboxdrv-started
# this triggers two upstart jobs
# /etc/init/phpvirtualbox.conf
description "php virtualbox server"
# emmited by vboxdrv init file
start on vboxdrv-started
stop on runlevel [!2345]
exec su -s /bin/sh -c 'exec "$0" "$@"' phpvirtualbox -- /usr/bin/vboxwebsrv -H 192.x.x.x --background
# /etc/init/graylog2-vm.conf
description "graylog2 vm"
start on vboxdrv-started
stop on runlevel [!2345]
exec su -s /bin/sh -c 'exec "$0" "$@"' phpvirtualbox -- /usr/lib/virtualbox/VBoxHeadless --startvm {VMUUID} --vrde config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment