So I have another computer running 24/7 and I forget to turn it back on when I restart. I also want it to gracefully save when I reboot so in the event I kick somebody off their work is not lost!I have tried @reboot via crontab, but the VboxHeadless command does not seem to work in conjunction with @reboot. I think its a timing issue.So I have researched more and was guided to make a Upstart Script. How can I go about this?
Autostart Virtual Machine VBoxHeadless at boot with Upstart - init and Graceful exit
virtualbox;init.d;upstart
First create the script, then make it executable, then install it. Note: I copied/changed the code, but im not sure what defaults 99 01 meanssudo nano /etc/init.d/StartVM && sudo chmod +x /etc/init.d/StartVM && sudo update-rc.d StartVM defaults 99 01/etc/init.d/StartVM Contents:#! /bin/sh# Start VirtualBox @boot # /etc/init.d/StartVM##Edit these variables!VMUSER=userVMNAME=VM1VMNAME2=Testcase $1 in  start)    echo Starting VirtualBox VM ...    sudo -u $VMUSER VBoxHeadless --startvm $VMNAME &    sudo -u $VMUSER VBoxHeadless --startvm $VMNAME2 &    ;;  stop)    echo Saving state of Virtualbox VM ...    sudo -u $VMUSER VBoxManage controlvm $VMNAME savestate    sudo -u $VMUSER VBoxManage controlvm $VMNAME2 savestate    ;;  *)    echo Usage: /etc/init.d/StartVM {start|stop}    exit 1    ;;esacexit 0