fleshwounded
11/17/2018 - 6:04 AM

Script that automatically save the state of all running VMs on Linux

saveRunningVMs.sh for Linux: script that automatically save the state of all running VMs without naming them explicitly.

#!/bin/bash
vboxmanage list runningvms | while read line; do
  #echo "VBoxManage controlvm $uuid savestate;"
  echo $line
  if [[ $line =~ \{(.*)\} ]]
  then
    vboxmanage controlvm ${BASH_REMATCH[1]} savestate
  fi
done