1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
2 | <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
3 | <topic xml:lang="en-us" id="autostart-linux">
|
---|
4 | <title>Linux: Starting the Autostart Service With init</title>
|
---|
5 |
|
---|
6 | <body>
|
---|
7 | <p>On Linux, the autostart service is activated by setting two variables in
|
---|
8 | <filepath>/etc/default/virtualbox</filepath>. The first one is <codeph>VBOXAUTOSTART_DB</codeph> which
|
---|
9 | contains an absolute path to the autostart database directory. The directory should have write access for
|
---|
10 | every user who should be able to start virtual machines automatically. Furthermore the directory should have
|
---|
11 | the sticky bit set. The second variable is <codeph>VBOXAUTOSTART_CONFIG</codeph> which points the service to
|
---|
12 | the autostart configuration file which is used during boot to determine whether to allow individual users to
|
---|
13 | start a VM automatically and configure startup delays. The configuration file can be placed in
|
---|
14 | <filepath>/etc/vbox</filepath> and contains several options. One is <codeph>default_policy</codeph>
|
---|
15 | which controls whether the autostart service allows or denies to start a VM for users which are not in the
|
---|
16 | exception list. The exception list starts with <codeph>exception_list</codeph> and contains a comma
|
---|
17 | separated list with usernames. Furthermore a separate startup delay can be configured for every user to
|
---|
18 | avoid overloading the host. A sample configuration is given below: </p>
|
---|
19 | <pre xml:space="preserve"># Default policy is to deny starting a VM, the other option is "allow".
|
---|
20 | default_policy = deny
|
---|
21 |
|
---|
22 | # Bob is allowed to start virtual machines but starting them
|
---|
23 | # will be delayed for 10 seconds
|
---|
24 | bob = {
|
---|
25 | allow = true
|
---|
26 | startup_delay = 10
|
---|
27 | }
|
---|
28 |
|
---|
29 | # Alice is not allowed to start virtual machines, useful to exclude certain users
|
---|
30 | # if the default policy is set to allow.
|
---|
31 | alice = {
|
---|
32 | allow = false
|
---|
33 | }
|
---|
34 | </pre>
|
---|
35 | <p>Any user who wants to enable autostart for individual machines must set the path to the autostart database
|
---|
36 | directory with the following command: </p>
|
---|
37 | <pre xml:space="preserve">VBoxManage setproperty autostartdbpath <varname>autostart-directory</varname>
|
---|
38 | </pre>
|
---|
39 | </body>
|
---|
40 |
|
---|
41 | </topic>
|
---|