#!/bin/bash # # script that can be run in cron to check if the virtualbox is still running # if not, start it # # Requires vboxcontrol (http://farfewertoes.com/code/vboxcontrol/) # # -- Kenny Gryp # for machine in `cat /etc/virtualbox/machines_enabled ` do running=`/etc/init.d/vboxcontrol status | grep "\($machine\)"` if [ "$running" == "" ]; then echo "VirtualBox machine '$machine' is not running anymore, restarting" echo "" /etc/init.d/vboxcontrol start-vm "$machine" fi done