I have configured autorun VirtualBox follows:
/etc/default/virtualbox
Code: Select all
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vboxautostart.cfg
Code: Select all
default_policy = deny
administrator = {
allow = true
startup_delay = 10
}
Code: Select all
# chgrp vboxusers /etc/vbox
# chmod 1775 /etc/vbox
$ VBoxManage setproperty autostartdbpath /etc/vbox
$ VBoxManage modifyvm WinXP_SP3_RU --autostart-enabled on
$ VBoxManage modifyvm WinXP_SP3_RU --autostop-type acpishutdown
Code: Select all
# systemctl start vboxautostart-service.service
Code: Select all
# systemctl stop vboxautostart-service.service
Code: Select all
root@linux:~# systemctl status vboxautostart-service.service
● vboxautostart-service.service
Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
Active: inactive (dead) since Пт 2016-10-07 14:07:31 MSK; 6s ago
Process: 14311 ExecStop=/usr/lib/virtualbox/vboxautostart-service.sh stop (code=exited, status=0/SUCCESS)
CGroup: /system.slice/vboxautostart-service.service
├─13909 /usr/lib/virtualbox/VBoxXPCOMIPCD
├─13914 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
├─13976 /usr/lib/virtualbox/VBoxHeadless --comment WinXP_SP3_RU --startvm 45df8aec-e1c1-43ed-be03-ff6d5429d226 --
└─29701 /usr/bin/pulseaudio --start --log-target=syslog
окт 07 14:05:24 erp-server systemd[1]: Starting vboxautostart-service.service...
окт 07 14:05:24 erp-server vboxautostart-service.sh[13892]: vboxautostart-service.sh: Starting VirtualBox VMs configured for
окт 07 14:05:24 erp-server systemd[1]: Started vboxautostart-service.service.
окт 07 14:05:31 erp-server systemd[1]: Started vboxautostart-service.service.
окт 07 14:07:31 erp-server systemd[1]: Stopping vboxautostart-service.service...
окт 07 14:07:31 erp-server systemd[1]: Stopped vboxautostart-service.service.
Code: Select all
# /usr/lib/virtualbox/vboxautostart-service.sh stop
P.S.
In the process of debugging, randomly forced the demon to work.
To do this, edit the line 80 in the file /usr/lib/virtualbox/vboxautostart-service.sh
From:
Code: Select all
start-stop-daemon --background --chuid $usr --start --exec $bin -- $@
Code: Select all
start-stop-daemon --background --no-close --chuid $usr --start --exec $bin -- $@ 2>&1 | logger
But of course this is not the solution.