Page 1 of 1

PLEASE HELP Autostart feature for vm guest

Posted: 20. Oct 2016, 20:22
by bradyt
Im sure this topic has been discussed more than ever, but I have not found a solution through google that has my setup working yet. I am running Ubuntu 16.04 as a host with virtualbox version 5.1.6 . I just cant seem to find a working script or am confused with the way it needs to be setup. I noticed there is a autostart feature, but need help with setup instructions. Please help

Re: Autostart feature for vm guest

Posted: 20. Oct 2016, 20:49
by socratis

Re: Autostart feature for vm guest

Posted: 20. Oct 2016, 22:39
by bradyt
I am hoping that someone can help walk me in the right direction on this one. I have a little experience with linux, but not a pro. When I read the instructions I did what I thought It was asking. Heres what I got so far:

File - /etc/default/virtualbox

VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vboxauto.conf

Load_VBOXDRV_MODULE=1

SHUTDOWN_USERS="ccb administrator" ((this would be any user names associated with vm guests username login right?? So if I had a vm that was a file server and the login username was administrator, than it would be in this list I would assume??))
SHUTDOWN=poweroff

File - /etc/vbox/vboxauto.conf

default_policy = deny
ccb = {
allow = true
startup_delay = 10
}
(((Wouldn't this be the username of the host linux machine to log in to??)))

Permissions for vboxauto.conf:

-rwxrwx--T 1 root root 64 0ct 20 12:12 vboxauto.conf


I thought I covered all the grounds, but wanted to show you what I have so far and see what you guys might find that I did wrong. Even If you could dummy the instructions down a little that might help. Thanks guys




Starting with VirtualBox 4.2.0 it is possible to start VMs automatically during system boot on Linux, Solaris and Mac OS X for all users.

9.24.1. Linux: starting the autostart service via init

On Linux, the autostart service is activated by setting two variables in /etc/default/virtualbox. The first one is VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory. The directory should have write access for every user who should be able to start virtual machines automatically. Furthermore the directory should have the sticky bit set. The second variable is VBOXAUTOSTART_CONFIG which points the service to the autostart configuration file which is used during boot to determine whether to allow individual users to start a VM automatically and configure startup delays. The configuration file can be placed in /etc/vbox and contains several options. One is default_policy which controls whether the autostart service allows or denies to start a VM for users which are not in the exception list. The exception list starts with exception_list and contains a comma separated list with usernames. Furthermore a separate startup delay can be configured for every user to avoid overloading the host. A sample configuration is given below:

# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny

# Bob is allowed to start virtual machines but starting them
# will be delayed for 10 seconds
bob = {
allow = true
startup_delay = 10
}

# Alice is not allowed to start virtual machines, useful to exclude certain users
# if the default policy is set to allow.
alice = {
allow = false
}

Every user who wants to enable autostart for individual machines has to set the path to the autostart database directory with

VBoxManage setproperty autostartdbpath <Autostart directory>