Please help. VM image cannot auto start after host (ubuntu 16.04 LTS) reboot.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Saeba
Posts: 12
Joined: 6. Aug 2016, 11:58

Please help. VM image cannot auto start after host (ubuntu 16.04 LTS) reboot.

Post by Saeba »

My VM is hosted on Ubuntu 16.04 LTS and I followed the link to do VM restart after host rebooting, but no matter how I tried, it is still not working with the following error message. Can anyone help me?
http://askubuntu.com/questions/404665/h ... en-booting

my error message is as follow.

root@ bbb-tccu:/home/tommy/vbox.image/Windows XP1# vi /etc/vbox/autostart.cfg
root@ bbb-tccu:/home/tommy/vbox.image/Windows XP1# service vboxautostart-service stop
root@ bbb-tccu:/home/tommy/vbox.image/Windows XP1# service vboxautostart-service start
Job for vboxautostart-service.service failed because the control process exited with error code. See "systemctl status vboxautostart-service.service" and "journalctl -xe" for details.
root@ bbb-tccu:/home/tommy/vbox.image/Windows XP1#
root@ bbb-tccu:/home/tommy/vbox.image/Windows XP1#
root@ bbb-tccu:/home/tommy/vbox.image/Windows XP1# systemctl status vboxautostart-service.service
â vboxautostart-service.service - LSB: VirtualBox autostart service
Loaded: loaded (/etc/init.d/vboxautostart-service; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2016-08-30 11:58:06 EDT; 20s ago
Docs: man:systemd-sysv-generator(8)
Process: 4135 ExecStart=/etc/init.d/vboxautostart-service start (code=exited, status=2)

Aug 30 11:58:06 bbb-tccu systemd[1]: Starting LSB: VirtualBox autostart service...
Aug 30 11:58:06 bbb-tccu vboxautostart-service[4135]: /etc/init.d/vboxautostart-service: 2: /etc/vbox/autostart.cfg: default_policy: not found
Aug 30 11:58:06 bbb-tccu vboxautostart-service[4135]: /etc/init.d/vboxautostart-service: 5: /etc/vbox/autostart.cfg: vbox: not found
Aug 30 11:58:06 bbb-tccu vboxautostart-service[4135]: /etc/init.d/vboxautostart-service: 6: /etc/vbox/autostart.cfg: allow: not found
Aug 30 11:58:06 bbb-tccu vboxautostart-service[4135]: /etc/init.d/vboxautostart-service: 7: /etc/vbox/autostart.cfg: Syntax error: "}" unexpected
Aug 30 11:58:06 bbb-tccu systemd[1]: vboxautostart-service.service: Control process exited, code=exited status=2
Aug 30 11:58:06 bbb-tccu systemd[1]: Failed to start LSB: VirtualBox autostart service.
Aug 30 11:58:06 bbb-tccu systemd[1]: vboxautostart-service.service: Unit entered failed state.
Aug 30 11:58:06 bbb-tccu systemd[1]: vboxautostart-service.service: Failed with result 'exit-code'.

It seems that vmsrv process does not recognize config file at all.

HELP HELP and HELP .....
JSA
Posts: 26
Joined: 25. Aug 2016, 03:24
Primary OS: openSUSE
VBox Version: OSE other
Guest OSses: Windows Linux
Location: USA

Re: Please help. VM image cannot auto start after host (ubuntu 16.04 LTS) reboot.

Post by JSA »

Sounds like you have some naming convention problems in your systemd stuff.
See this page.
http://www.ericerfanian.com/automatical ... g-systemd/
Saeba
Posts: 12
Joined: 6. Aug 2016, 11:58

Re: Please help. VM image cannot auto start after host (ubuntu 16.04 LTS) reboot.

Post by Saeba »

I followed your suggestion steps in the link, but without luck.

my vm name is "Windows XP1 ". There is an empty space between Windows and XP1.
The steps suggested to create a file, "vboxvmservice@service-name.service" ,inside /etc/systemd/system directory, and use command as following:

# systemctl enable vboxvmservice@'Windows XP1'.service

and I tried
# systemctl -fail <== and I got

ufw.service loaded active
unattended-upgrades.service loaded inactive
ureadahead-stop.service loaded inactive
ureadahead.service loaded inactive
user@1001.service loaded active
uuidd.service loaded inactive

â vboxautostart-service.service loaded failed
â vboxvmservice@Windows\x20XP1.service loaded failed

vboxweb.service loaded active
virtualbox.service loaded active
vmware-tools.service loaded active
vsftpd.service loaded active
....
....

After system reboot, no VM was up so far. Any idea ?
Saeba
Posts: 12
Joined: 6. Aug 2016, 11:58

Re: Please help. VM image cannot auto start after host (ubuntu 16.04 LTS) reboot.

Post by Saeba »

Finally, I tried the following change steps.

(1) change my vm name from "Windows XP1" to "WindowsXP1" with no space.
(2) I do a reboot and wait to see if this vm is running, but no luck at all.
(3) I manually type in /usr/bin/VBoxHeadless -s WindowsXP1 <== and it runs !!

Can you help me to see what's going on here? Why I can manually run this vm, but cannot pass reboot autostart ?

It seems that systemctld does not take this command and run it !
ExecStart=/usr/bin/VBoxHeadless -s %i
Saeba
Posts: 12
Joined: 6. Aug 2016, 11:58

Re: Please help. VM image cannot auto start after host (ubuntu 16.04 LTS) reboot.

Post by Saeba »

I tried a lot of way to pass reboot autostart, but still not working. I give up using systemctld to implement this.

I edit /etc/rc.local and put the following line to it, still without luck.

### rc.local ###
/usr/bin/VBoxHeadless -s WindowsXP1 &

it seems that only root privilege can run it. how can this be done ? Can you help ?

-tommy
Post Reply