In Ubuntu 12.04 LTS, I tried to configure Virtualbox 4.2 to start my VM automatically when the system starts up. However, I got an error message as below after following the instructions in chapter 9.24.1 in Virtualbox User Manual:
VBoxManage: error: Adding machine ‘Ubuntu-VM’ to the autostart database failed with VERR_ACCESS_DENIED
Then I realized that I missed giving write acccess for virtualbox users on autostart database directory (/etc/vbox) and setting the sticky bit:
- sudo chgrp vboxusers /etc/vbox
- sudo chmod 1775 /etc/vbox
* Check if your user is in vboxusers group by executing “groups <userid>” command.
I set the autostart database directory for the user:
- VBoxManage setproperty autostartdbpath /etc/vbox
And executed once again the command to set my VM (Ubuntu-VM) to automatically startup:
- VBoxManage modifyvm Ubuntu-VM –autostart-enabled on
* After executing this command, you should have <userid>.start file under /etc/vbox directory.
** If you still get the same error message, manually create <userid>.start file under /etc/vbox.
I restarted the vboxauto service for changes to take effect:
- sudo service vboxautostart-service stop
- sudo service vboxautostart-service start
After setting the required write permission and sticky bit on the /etc/box directory, it worked.
Thanks a lot Yakup. You saved my day!
Thank you. This helped.
I needed to do the following steps:
sudo touch /etc/vbox/username.start
sudo chown username/etc/vbox/username.start
VBoxManage modifyvm vm-name –autostart-enabled on
Thank you, this and the documentation helped me a lot.
Docs: https://www.virtualbox.org/manual/ch09.html#autostart-linux