I cannot seem to get my VM to run at startup.
I tried the "startup applications" and update-rc.d with no luck.
sudo update-rc.d startvms defaults 99 10
This created all the appropriate symbolic links for the different run levels but the VM still does not start.
Here's my startvms script:
#!/bin/bash
### BEGIN INIT INFO
# Provides: startvms
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start my VMs at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
case "$1" in
start)
echo "Starting"
nohup VBoxHeadless --startvm "UbuntuServer" &
;;
stop)
echo "Stopping $DESC"
VBoxManage controlvm "UbuntuServer" poweroff
;;
restart|force-reload)
echo "Restarting $DESC"
VBoxManage controlvm "UbuntuServer" poweroff
nohup VBoxHeadless --startvm "UbuntuServer" &
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
What am i doing wrong?
VBoxManage startvm --type headless "UbuntuServer"
instead ofVBoxHeadless
command?su -c 'VBoxHeadless --startvm <MACHINE>'
.