网址: https://www.virtualbox.org/manual/ch09.html#autostart-windows
9.21.4. Windows: Starting the Autostart Service
On Windows, autostart functionality consist of two components. First one is configuration file where the administrator can both set delayed start of the VMs and temporary disable autostarting for the particular user. The configuration file should be located in the folder accessible by all required users but it should have permissions allowing the only reading by everyone but administrators. The configuration file 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
}
The user name can be specified using the following forms: "user", "domain\user", ".\user" and "user@domain". Administrator must add the VBOXAUTOSTART_CONFIG environment variable into system variables containing the path to the configuration file described above. The environment variable tells the autostart services what configuration file is used.
Second component of autostart functionality is Windows service, every instance of it works on behalf of particular user using its own credentials.
To enable autostarting for a particular user, a member of the administrators group must run the following command:
VBoxAutostartSvc install --user=user [--password-file=password_file]
The password file should contain the password followed by a line break. The rest of the file is ignored. The user will be asked for a password if the password file is not specified.
To disable autostarting for particular user, a member of the administrators group must run the following command:
VBoxAutostartSvc delete --user=user
If a user has changed their password then a member of the administrators group must either reinstall the service or change the service credentials using Windows Service Manager. Due to Windows security policies, the autostart service cannot be installed for users with empty passwords.
Finally, the particular user should define which VM should be started at boot or not. The user should run the following command for every VM it desired to start at boot:
VBoxManage modifyvm VM name or UUID --autostart-enabled on
The user can remove the particular VM from the VMs starting at boot by running the following command:
VBoxManage modifyvm VM name or UUID --autostart-enabled off