911-poweron-allvms
#!/bin/bash
#
# Power on all designated VMs
#
# Run user check
if [ "$UID" -eq 0 ]
  then echo "This script should NOT be run as root."
  exit 1
fi
#
# Source config file
if [ ! -f ~/.vbconfig ]; then
    echo "Config File ~/.vbconfig not found!"
    echo "Run: set-folders to create .vbconfig"
    exit 1
fi
. ~/.vbconfig
#
# Sleep interval between powerons
#SLEEPINT=61
SLEEPINT=11
#
RUN_VM_LIST=`cat $VB_BIN_LOC/vm-start-list.txt`
IFS=$'\n'
for VB_VM_NAME in $RUN_VM_LIST
do
  echo "Poweron of VM $VB_VM_NAME"
  VBoxManage startvm "${VB_VM_NAME}" --type headless
  echo "Sleeping $SLEEPINT second(s) ..."
  sleep $SLEEPINT
done
#
exit

QR Code
QR Code scripts:911-poweron-allvms (generated for current page)