

So.now all that's necessary to start a virtual machine is: systemctl start More exciting - systemctl status will provide systemd status of the VM! And you can even do a systemctl stop to turn it off. & & kill -s 9 $PIDFILEĮcho "Usage: vbox-systemd " >&2 # Time to clean up - force terminate if necessary and delete the pid file # Test first so VB doesn't object to shutting off a non-running VMĮcho "Proper ACPI Shutdown of $VM - or it wasn't running!" Vmpid=$($VB showvminfo $VM -log 0 | $GREP -m 1 'Process ID' | $CUT -d ':' -f4 | $TR -d ' ') Vmactive=`$VB list runningvms | grep $VM | cut -d ' ' -f 1 | tr -d '"'` # Give it at least a change to get started. Vmactive=$($VB list runningvms | grep $VM | cut -d ' ' -f 1 | tr -d '"')

Get a list of your VM's VBoxManage list vms:

Similar to your solution, but a bit simpler:
