VirtualBox 5.0 - Kernel modules are "lost" after each reboot

Discussions related to using VirtualBox on Linux hosts.
Vladimir Korenev
Posts: 1
Joined: 16. Sep 2015, 08:45

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by Vladimir Korenev »

The .deb package does not enable systemd service. So you must execute:

Code: Select all

sudo systemctl enable vboxdrv
sudo systemctl start vboxdrv
Oracle guys, could you please release a fixed .deb for Ubuntu >= 15.04?
Darron
Posts: 7
Joined: 31. Mar 2015, 01:44

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by Darron »

FWIW, I have the same problem with VirtualBox 5.04 running under Fedora 22. I installed VirtualBox from the rpm in the virtualbox repository. After every Linux reboot, any attempt to start my Windows 10 VM results in failure. VirtualBox reports that the VM stopped with "exit code 1" NS_ERROR_FAILURE 00x80004005, with MachineWrap as the relevant component. Running "sudo /etc/init.d/vboxdrv setup" and then signing the kernel modules allows me to start the VM, but I have to go through the whole process again after the next reboot of Linux.

Here's what journalct -u vboxdrv produces:

systemd[1]: [/usr/lib/systemd/system/vboxdrv.service:5] Failed to add dependency on $syslog.service, ignoring: Invalid argument
Starting vboxdrv.service...
Failed at step EXEC spawning /opt/VirtualBox/vboxdrv.sh: No such file or directory
vboxdrv.service: control process exited, code=exited status=203
Failed to start vboxdrv.service.
Unit vboxdrv.service entered failed state.
vboxdrv.service failed.

It's not a big deal to reinstall the kernel modules after every reboot, but it's be nice to learn if there's something about my setup that I've broken or if there could be a fix for the VirtualBox rpm package.

Darron
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by michael »

Darron, I see that you have a systemd service for vboxdrv installed, and one which looks like it comes from the "all distributions" .run installer. VirtualBox 5.04 from our repositories should not contain any systemd units, only sysvinit scripts. My guess is that something got messed up and that is what is causing your problem.
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by michael »

Vladimir, that should apply to the .deb too, if you got it from us.
Darron
Posts: 7
Joined: 31. Mar 2015, 01:44

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by Darron »

Michael,

Thanks for the quick response to my post - I really appreciate it. Before VirtualBox 5.04 was released, I had installed a build of 5.03 using the "all distributions" .run installer. I guess I must not have completely and correctly removed 5.03 before installing the 5.04 rpm. That probably accounts for the systemd units and, as you suggest, the problem I'm having. I'll see about making sure that the systemd units and any other remnants of the 5.03 install are removed and try my luck again.

Darron
Darron
Posts: 7
Joined: 31. Mar 2015, 01:44

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by Darron »

Removing the vbox systemd units did indeed fix the problem for me. Thanks again for your quick response, Michael.

Darron
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by michael »

Glad that was fixed and thanks for the feedback. By co-incidence I am just making changes to our service handling (unifying the way that different installers do it, currently done for RPM and "all distributions", I hope it will land in future 5.0 releases) which should prevent that from happening in the first place.
actionmystique
Posts: 28
Joined: 28. Feb 2013, 10:18
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Ubuntu 15.04, Windows 7, Windows Server
Location: Paris, France

Re: VirtualBox 5.0 - Kernel modules are "lost" after each re

Post by actionmystique »

Thanks to Darron for helping us solve this issue.

On Ubuntu 15.04, I disabled the vboxdrv service, removed the /run/systemd/generator.late/vboxdrv.service file, rebooted and:

Code: Select all

root@msi-ge60-ubuntu:/usr/share/applications# systemctl enable vboxdrv
Synchronizing state for vboxdrv.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d vboxdrv defaults
insserv: script vboxdrv: service vboxdrv already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
root@msi-ge60-ubuntu:/usr/share/applications# systemctl start vboxdrv
root@msi-ge60-ubuntu:/usr/share/applications# systemctl status vboxdrv
● vboxdrv.service - LSB: VirtualBox Linux kernel module
   Loaded: loaded (/etc/init.d/vboxdrv)
   Active: active (exited) since Mon 2015-09-21 12:22:06 CEST; 4s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 8926 ExecStart=/etc/init.d/vboxdrv start (code=exited, status=0/SUCCESS)

Sep 21 12:22:06 msi-ge60-ubuntu systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Sep 21 12:22:06 msi-ge60-ubuntu vboxdrv[8926]: Starting VirtualBox kernel modules ...done.
Sep 21 12:22:06 msi-ge60-ubuntu systemd[1]: Started LSB: VirtualBox Linux kernel module.
You'll notice the "insserv rejected the script header" error still present and during reboot, the same error message pops up "VBOX kernel service is not running: exiting."
However, now I do NOT need to run "/etc/init.d/vboxdrv setup" at each boot.

In order to definitely solve this issue, you should completely switch over to systemd on distributions which have made the move; upstart is in the past now for us.
Jean-Christophe Manciot
G+/+jeanchristopheManciot-IT/posts
Twitter @jc_manciot
GitHub /jean-christophe-manciot
Post Reply