Quick script – start VirtualBox VM in headless mode at boot time

#! /bin/sh
# /etc/init.d/StartVM
#

#Edit these variables!
VMUSER=ico
VMNAMES='browserkiosk01 browserkiosk02 browserkiosk03 browserkiosk04'
POWEROFF=acpipowerbutton
case "$1" in
 start)
 echo "Starting VirtualBox VM..."
 for vmname in $VMNAMES
 do
 sudo -H -b -u $VMUSER /usr/bin/VBoxVRDP -s "$vmname"
 sleep 30
 done
 ;;
 stop)
 echo "Saving state of Virtualbox VM..."
 for vmname in $VMNAMES
 do
 sudo -H -u $VMUSER /usr/bin/VBoxManage controlvm "$vmname" $POWEROFF
 sleep 10
 done
 ;;
 *)
 echo "Usage: /etc/init.d/StartVM {start|stop}"
 exit 1
 ;;
esac
exit 0

http://askubuntu.com/questions/57220/start-vboxheadless-vm-at-startup

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: