Autostart does not work on boot Ubuntu 16.04 VirtualBox 5.1
Posted: 7. Sep 2016, 21:55
I have a fresh install of Ubuntu 16.04 Server and VirtualBox 5.1. I have an Ubuntu guest created on an NFS mount with the storage attached to an iSCSI LUN on my NAS. Starting and stopping it manually works fine.
Manually starting the guest works via any one of these commands:
I'm guessing here... do I need to rename them to S04 and S05 respectively? At the least, I think S03vboxautostart-service needs to start much later. Thoughts on this?
Snippets of the syslog
--- potentially useful information ----
I moved the default machine folder to a mount:
/etc/default/virtualbox
/etc/vbox
/etc/vbox/autostart.cfg
systemctl -l status vboxautostart-service.service
Manually starting the guest works via any one of these commands:
- VBoxHeadless --startvm "Ubuntu Server"
sudo service vboxautostart-service restart
vboxautostart --start --config /etc/vbox/autostart.cfg
I'm guessing here... do I need to rename them to S04 and S05 respectively? At the least, I think S03vboxautostart-service needs to start much later. Thoughts on this?
Snippets of the syslog
Code: Select all
Sep 7 15:12:03 MyHost systemd[1]: Starting Authenticate and Authorize Users to Run Privileged Tasks...
Sep 7 15:12:03 MyHost vboxdrv.sh[2811]: vboxdrv.sh: Starting VirtualBox services.
...
Sep 7 15:12:03 MyHost vboxdrv.sh: Starting VirtualBox services.
...
Sep 7 15:12:03 MyHost kernel: [ 14.354340] vboxdrv: module verification failed: signature and/or required key missing - tainting kernel
Sep 7 15:12:03 MyHost kernel: [ 14.359014] vboxdrv: Found 4 processor cores
...
Sep 7 15:12:03 MyHost kernel: [ 14.378254] vboxdrv: TSC mode is Invariant, tentative frequency 1596300487 Hz
Sep 7 15:12:03 MyHost kernel: [ 14.378258] vboxdrv: Successfully loaded version 5.1.4 (interface 0x00260000)
...
Sep 7 15:12:04 MyHost kernel: [ 14.582075] VBoxNetFlt: Successfully started.
Sep 7 15:12:04 MyHost kernel: [ 14.583189] VBoxNetAdp: Successfully started.
Sep 7 15:12:04 MyHost kernel: [ 14.584579] VBoxPciLinuxInit
Sep 7 15:12:04 MyHost vboxdrv.sh: VirtualBox services started.
Sep 7 15:12:04 MyHost kernel: [ 14.586318] vboxpci: IOMMU not found (not registered)
Sep 7 15:12:04 MyHost systemd[1]: Started VirtualBox Linux kernel module.
Sep 7 15:12:04 MyHost systemd[1]: Starting vboxautostart-service.service...
Sep 7 15:12:04 MyHost systemd[1]: Starting vboxballoonctrl-service.service...
Sep 7 15:12:04 MyHost vboxautostart-service.sh[3023]: vboxautostart-service.sh: Starting VirtualBox VMs configured for autostart.
Sep 7 15:12:04 MyHost vboxautostart-service.sh: Starting VirtualBox VMs configured for autostart.
Sep 7 15:12:04 MyHost systemd[1]: Starting vboxweb-service.service...
Sep 7 15:12:04 MyHost systemd[1]: Started vboxballoonctrl-service.service.
Sep 7 15:12:04 MyHost systemd[1]: Started vboxweb-service.service.
Sep 7 15:12:04 MyHost systemd[1]: Started vboxautostart-service.service.
...
Sep 7 15:12:10 MyHost systemd[1]: Starting iSCSI initiator daemon (iscsid)...
Sep 7 15:12:10 MyHost systemd[1]: Starting OpenBSD Secure Shell server...
Sep 7 15:12:10 MyHost systemd[1]: Started /etc/rc.local Compatibility.
Sep 7 15:12:10 MyHost iscsid: iSCSI logger with pid=3172 started!
Sep 7 15:12:10 MyHost systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 7 15:12:10 MyHost systemd[1]: Starting Login to default iSCSI targets...
Sep 7 15:12:10 MyHost iscsiadm[3180]: iscsiadm: No records found
Sep 7 15:12:10 MyHost systemd[1]: Started OpenBSD Secure Shell server.
Sep 7 15:12:10 MyHost systemd[1]: Started Login to default iSCSI targets.
Sep 7 15:12:10 MyHost systemd[1]: Reached target Remote File Systems (Pre).
Sep 7 15:12:10 MyHost systemd[1]: Mounting /mnt/nfs/myNas...
Sep 7 15:12:10 MyHost kernel: [ 21.235486] FS-Cache: Loaded
Sep 7 15:12:10 MyHost kernel: [ 21.247575] FS-Cache: Netfs 'nfs' registered for caching
Sep 7 15:12:10 MyHost kernel: [ 21.258497] NFS: Registering the id_resolver key type
Sep 7 15:12:10 MyHost kernel: [ 21.258505] Key type id_resolver registered
Sep 7 15:12:10 MyHost kernel: [ 21.258506] Key type id_legacy registered
Sep 7 15:12:10 MyHost systemd[1]: Mounted /mnt/nfs/myNas.
--- potentially useful information ----
I moved the default machine folder to a mount:
Code: Select all
vboxmanage list systemproperties | grep "machine folder"
Default machine folder: /mnt/nfs/myNas/virtualbox/vm-user
Code: Select all
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
SHUTDOWN_USERS="vm-user"
SHUTDOWN=acpibutton
Code: Select all
sudo chgrp vboxusers /etc/vbox
sudo chmod 1775 /etc/vbox
ls -ld /etc/vbox/
drwxrwxr-t 2 root vboxusers 4096 Sep 7 10:43 /etc/vbox/
VBoxManage modifyvm "Ubuntu Server" --autostart-enabled on
VBoxManage modifyvm "Ubuntu Server" --autostop-type acpishutdown
ls -l /etc/vbox/
total 12
-rw-r--r-- 1 root root 176 Sep 7 09:45 autostart.cfg
-rw------- 1 vm-user vm-user 1 Sep 7 10:43 vm-user.start
-rw------- 1 vm-user vm-user 1 Sep 7 10:43 vm-user.stop
Code: Select all
# Default policy is to deny starting a VM, the other option is "allow".
Default_policy = deny
# Create an entry for each user allowed to run autostart
vm-user = {
allow = true
}
Code: Select all
● vboxautostart-service.service
Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2016-09-07 15:12:04 EDT; 1min 6s ago
Process: 3023 ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
Sep 07 15:12:04 MyHost systemd[1]: Starting vboxautostart-service.service...
Sep 07 15:12:04 MyHost vboxautostart-service.sh[3023]: vboxautostart-service.sh: Starting VirtualBox VMs configured for autostart.
Sep 07 15:12:04 MyHost vboxautostart-service.sh[3028]: Starting VirtualBox VMs configured for autostart.
Sep 07 15:12:04 MyHost systemd[1]: Started vboxautostart-service.service.