Auto start Virtual Machine – Ubuntu 14.04 LTS

So if you have been following my latest guides, you probably have VirtualBox and Phpvirtualbox installed. Here is a script where you can autostart Virtual Machine on a headless server.


Step 1. Create your startup script.
You should create this file in etc/init.d/ and copy paste the script below to the file. Remember to change VMUSER and VMNAME so it match your Virtualbox user and the name of the virtual machine.



Step 2. Give the script the right permissions.

Step 3. Make the script to startup on boot.