2

I have VirtualBox 5 installed and working in Fedora for some 5-6 weeks with no problems after following this guide.

However after I ran a dnf update yesterday it stopped working.

VirtualBox itself launches but when I try to launch the VM here is what I get:

The virtual machine 'MyVM' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Machine
Interface: IMachine

With some further instructions on drill down:

Kernel Driver is not installed (rc= -1908)
The VirtualBox Linux kernel driver (kvboxdvr) is not loaded...

So here is what I tried so far without luck:
1.Checked what I have installed:

$ dnf list installed | grep kmod-VirtualBox*
akmod-VirtualBox.x86_64                    4.3.30-1.fc22                @rpmfusion-free-updates
kmod-VirtualBox-4.1.10-200.fc22.x86_64.x86_64
kmod-VirtualBox-4.1.7-200.fc22.x86_64.x86_64

2.Checked what is available in the repo:

$ dnf provides kmod-VirtualBox
Last metadata expiration check performed 0:03:30 ago on Sun Oct 18 10:37:47 2015.
kmod-VirtualBox-4.3.30-1.fc22.x86_64 : Metapackage which tracks in VirtualBox kernel module for newest kernel
Repo        : rpmfusion-free-updates

kmod-VirtualBox-4.3.28-1.fc22.x86_64 : Metapackage which tracks in VirtualBox kernel module for newest kernel
Repo        : rpmfusion-free

3.Tried to install updated kmod:

$ sudo dnf install --allowerasing kmod-VirtualBox-4.3.30-1.fc22.x86_64
Last metadata expiration check performed 1:43:30 ago on Sun Oct 18 09:05:58 2015.
Error: nothing provides kernel-uname-r = 4.0.8-300.fc22.x86_64 needed by kmod-VirtualBox-4.0.8-300.fc22.x86_64-4.3.30-1.fc22.x86_64

4.Run uname to check what is current version:

$ uname -r
4.2.3-200.fc22.x86_64

No matter what I try I keep getting this same error that nothing provides an outdated kernel. As far as I understand it shouldn't.

I ran a dnf clean all and dnf clean metadata but it didn't help. I also already run the dnf update virtualbox and it tells me I have the latest version installed. Any ideas how to solve this issue?

Note: I also tried running dnf update kmod-VirtualBox but nothing happens, it tells me something like "Nothing to Do."

1
  • Extra info: I just created a brand new VM and when I try to launch I get the same error message (I did expect that but I thought worthwhile confirming)
    – Fawix
    Oct 18, 2015 at 15:25

2 Answers 2

7

This happens from time to time because the current kmod package sometimes isn't in the repository yet.

You don't have to reinstall VirtualBox completely, but uninstalling the kmod packages might be necessary:

# dnf remove kmod-VirtualBox-*

However, you do not want to uninstall the akmod package because this is your alternative. If you install the required akmod packages (and no pre-built kmod packages), your system will build the VirtualBox kernel modules when necessary (after a kernel update), so this should always work - unlike the pre-build kmod packages, which aren't always available.

Install/update the akmod package and the kernel headers required for building:

# dnf install akmod-VirtualBox kernel-devel

You can start the build process manually:

# akmods

You may have to force a rebuild (see below):

# akmods --force

The modules service should not print any error messages anymore:

# systemctl restart systemd-modules-load

VirtualBox should now be able to start vms, even after kernel updates.

The build process might fail if there are still old kmod packages installed. In this case, uninstall them one by one and run akmods again.

Update:
This question is still relevant, even on Fedora 25. Note that akmods may have to be run with the --force option as shown above, especially when running the build manually. If you forget this option, it might simply show a warning and not do anything (Bug 4485):

Ignoring VirtualBox-kmod as it failed earlier              [WARNING]

This may also be the reason why VirtualBox sometimes won't start any VMs ("Kernel driver not installed") after a kernel update and subsequent reboot, even though all required packages are installed. Sometimes, the akmods tool complains that the previous build attempt was not successful and simply shows a warning instead of starting a new build. If this happens during a reboot, when the VirtualBox modules should be rebuilt automatically, you'd find this warning later in your system log and you will have to run akmods manually with the --force option, so that it'll actually start the build process that was supposed to run during the reboot. See bug 4485.

2
  • Oh, this is interesting! I'll try it next time I get that error message. Thanks!
    – Fawix
    Dec 2, 2015 at 15:56
  • The akmods was missing for me. Thanks
    – Honza
    Jan 31, 2016 at 11:21
2

So here is how I solved it after much fiddling around:

Last dnf update had a kernel update in it, in my case that bumped me from version 4.1 to version 4.2... so:

1.First I removed the, now, outdated kmod-VirtualBox I was using:

$ dnf list installed | grep kmod-VirtualBox*
akmod-VirtualBox.x86_64                    4.3.30-1.fc22                @rpmfusion-free-updates
kmod-VirtualBox-4.1.10-200.fc22.x86_64.x86_64
kmod-VirtualBox-4.1.7-200.fc22.x86_64.x86_64

$ sudo dnf remove kmod-VirtualBox-4.1.10-200.fc22.x86_64.x86_64
$ sudo dnf remove kmod-VirtualBox-4.1.7-200.fc22.x86_64.x86_64
$ sudo dnf remove akmod-VirtualBox.x86_64

This last one (akmod) might not have been necessary but I did it anyway.

2.I removed VirtualBox itself and then reboot.

$ dnf list installed | grep virtualbox
VirtualBox-5.0.x86_64                      5.0.6_103037_fedora22-1      @virtualbox
$ sudo dnf remove VirtualBox-5.0.x86_64
$ shutdown -r now

3.Once system was back from reboot I re-installed virtualbox and it installed the correct kmod:

$ sudo dnf install VirtualBox-5.0-5.0.6_103037_fedora22-1.x86_64

Now it's working again.

Hopefully this helps someone with the same problem since I wasted a full day trying to figure this out :)


Note: before going for a re-install try manually loading vboxdrv using the following:

$ sudo /etc/init.d/vboxdrv setup

In my case for whatever reason the driver was no longer there...

$ sudo /etc/init.d/vboxdrv setup
sudo: /etc/init.d/vboxdrv: command not found

...so I did a re-install and it solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.