I'd like to run my existing VMs after the host system boot.
I've tried to run the following command to add an line to the Cronbab:
VAGRANT_PWD="/home/ubuntu/vms"
(crontab -u $(whoami) -l; echo "@reboot cd $VAGRANT_PWD && sleep 20; /bin/su -c '/usr/bin/vagrant up' ubuntu" ) | crontab -u $(whoami) -
The line is present in the file but nothing happens on boot. The VMs are powered off.
I've also tried to add a line to the /etc/rc.local
file but without more success.
Is there a way to automatically start Vagrant VM (Virtualbox) on host startup ?