Bug 4162

Summary: VirtualBox akmods fails to build on kernel 4.6.4 (works on 4.4)
Product: Fedora Reporter: Basic Six <drbasic6>
Component: VirtualBoxAssignee: Sérgio Basto <sergio>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P5    
Version: 23   
Hardware: All   
OS: GNU/Linux   
namespace:
Attachments: 5.0.16-2-for-4.6.4-201.fc23.x86_64.failed.log

Description Basic Six 2016-08-02 12:49:04 CEST
Created attachment 1594 [details]
5.0.16-2-for-4.6.4-201.fc23.x86_64.failed.log

After updating Fedora 23, kernel 4.6.4 was installed.
VirtualBox does not seem to work on this kernel because its kernel modules cannot be compiled automatically. VirtualBox 5.0.16 is installed from the repository, along with akmods (no precompiled kmod package).

When running admods --force, the attached log file is generated.

Example:

/tmp/akmodsbuild.5Pr8s8HB/BUILD/VirtualBox-kmod-5.0.16/_kmod_build_4.6.4-201.fc23.x86_64/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1037:29: warning: passing argument 6 of 'get_user_pages' makes pointer from integer without a cast [-Wint-conversion]
Comment 1 Sérgio Basto 2016-08-02 12:54:51 CEST
it is a mirror problem ? let me know if is one mirror with problems , else  VirtualBox-5.0.26 is available . 

dnf repoquery --qf "%{name} %{sourcerpm} %{arch} %{repoid}" --available "VirtualBox*" --showduplicates 
Last metadata expiration check: 0:56:32 ago on Tue Aug  2 10:57:04 2016.
VirtualBox VirtualBox-5.0.16-3.fc23.src.rpm x86_64 rpmfusion-free
VirtualBox VirtualBox-5.0.26-1.fc23.src.rpm x86_64 rpmfusion-free-updates
VirtualBox-devel VirtualBox-5.0.16-3.fc23.src.rpm i686 rpmfusion-free
VirtualBox-devel VirtualBox-5.0.16-3.fc23.src.rpm x86_64 rpmfusion-free
VirtualBox-devel VirtualBox-5.0.26-1.fc23.src.rpm i686 rpmfusion-free-updates
VirtualBox-devel VirtualBox-5.0.26-1.fc23.src.rpm x86_64 rpmfusion-free-updates
VirtualBox-guest VirtualBox-5.0.16-3.fc23.src.rpm x86_64 rpmfusion-free
VirtualBox-guest-additions VirtualBox-5.0.26-1.fc23.src.rpm x86_64 rpmfusion-free-updates
VirtualBox-kmodsrc VirtualBox-5.0.16-3.fc23.src.rpm x86_64 rpmfusion-free
VirtualBox-kmodsrc VirtualBox-5.0.26-1.fc23.src.rpm x86_64 rpmfusion-free-updates
Comment 2 Basic Six 2016-08-02 18:15:20 CEST
Ok, looks like it's been fixed - 5.0.26 is available.

Although it was necessary to use the options "--best --allowerasing", otherwise dnf wouldn't update VirtualBox:

Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
 VirtualBox                x86_64        5.0.26-1.fc23          rpmfusion-free-updates         24 M
 VirtualBox-kmodsrc        x86_64        5.0.26-1.fc23          rpmfusion-free-updates        763 k
 akmod-VirtualBox          x86_64        5.0.26-1.fc23          rpmfusion-free-updates         26 k

The automatic build on startup failed for some reason.
But with this version, running akmods manually works kernel 4.6.4-201.fc23.x86_64, so VirtualBox works.
Comment 3 Sérgio Basto 2016-08-04 01:34:08 CEST
(In reply to comment #2)
> Ok, looks like it's been fixed - 5.0.26 is available.
> 
> Although it was necessary to use the options "--best --allowerasing", otherwise
> dnf wouldn't update VirtualBox:
> 
> Skipping packages with conflicts:
> (add '--best --allowerasing' to command line to force their upgrade):
>  VirtualBox                x86_64        5.0.26-1.fc23         
> rpmfusion-free-updates         24 M
>  VirtualBox-kmodsrc        x86_64        5.0.26-1.fc23         
> rpmfusion-free-updates        763 k
>  akmod-VirtualBox          x86_64        5.0.26-1.fc23         
> rpmfusion-free-updates         26 k
> 
> The automatic build on startup failed for some reason.
> But with this version, running akmods manually works kernel
> 4.6.4-201.fc23.x86_64, so VirtualBox works.

http://rpmfusion.org/Howto/VirtualBox

I works for me without --allowerasing, I use dnf update and:
Upgrading:
 VirtualBox      x86_64         5.0.26-1.fc23                rpmfusion-free-updates                           24 M
 VirtualBox-kmodsrc  x86_64     5.0.26-1.fc23                rpmfusion-free-updates                          763 k
 akmod-VirtualBox    x86_64     5.0.26-1.fc23                rpmfusion-free-updates                           26 k

without problem problem ,
what you have in `cat /var/log/dnf.rpm.log | grep VirtualBox` ?

cat /var/log/dnf.rpm.log | grep VirtualBox
Aug 03 06:07:41 INFO Erased: kmod-VirtualBox-4.5.7-200.fc23.x86_64-5.0.26-1.fc23.x86_64
Aug 03 06:10:16 INFO Installed: kmod-VirtualBox-4.7.0-2.fc23.x86_64-5.0.26-1.fc23.x86_64
Aug 03 23:39:21 INFO Erased: kmod-VirtualBox-4.7.0-2.fc23.x86_64-5.0.26-1.fc23.x86_64
Aug 03 23:40:16 INFO Erased: kmod-VirtualBox-4.6.5-200.fc23.x86_64-5.0.26-1.fc23.x86_64
Aug 03 23:40:38 INFO Erased: kmod-VirtualBox-4.6.4-201.fc23.x86_64-5.0.26-1.fc23.x86_64
Aug 03 23:40:57 INFO Erased: kmod-VirtualBox-4.5.7-202.fc23.x86_64-5.0.26-1.fc23.x86_64
Aug 03 23:44:20 INFO Downgraded: akmod-VirtualBox-5.0.16-2.fc23.x86_64
Aug 03 23:45:33 INFO Downgraded: VirtualBox-5.0.16-3.fc23.x86_64
Aug 03 23:45:33 INFO Erased: akmod-VirtualBox-5.0.26-1.fc23.x86_64
Aug 03 23:45:33 INFO Erased: VirtualBox-5.0.26-1.fc23.x86_64
Aug 03 23:48:19 INFO Downgraded: VirtualBox-kmodsrc-5.0.16-3.fc23.x86_64
Aug 03 23:48:19 INFO Erased: VirtualBox-kmodsrc-5.0.26-1.fc23.x86_64
Aug 03 23:49:40 INFO Installed: kmod-VirtualBox-4.5.7-202.fc23.x86_64-5.0.16-2.fc23.x86_64

here ends my downgrade (to test) and installed  kmod-VirtualBox-4.5.7-202.fc23.x86_64-5.0.16-2.fc23.x86_64

with dnf update: 
Aug 04 00:24:13 INFO Upgraded: VirtualBox-kmodsrc-5.0.26-1.fc23.x86_64
Aug 04 00:24:13 INFO Upgraded: akmod-VirtualBox-5.0.26-1.fc23.x86_64
Aug 04 00:25:00 INFO Upgraded: VirtualBox-5.0.26-1.fc23.x86_64
Aug 04 00:25:27 INFO Cleanup: akmod-VirtualBox-5.0.16-2.fc23.x86_64
Aug 04 00:25:28 INFO Cleanup: VirtualBox-5.0.16-3.fc23.x86_64
Aug 04 00:26:07 INFO Cleanup: VirtualBox-kmodsrc-5.0.16-3.fc23.x86_64
Aug 04 00:28:05 INFO Installed: kmod-VirtualBox-4.7.0-2.fc23.x86_64-5.0.26-1.fc23.x86_64
...
Comment 4 Basic Six 2016-08-04 11:57:30 CEST
That grep returns nothing (and half of the file consists of "INFO --- logging initialized ---", 130 lines, not very useful). You know, the same thing happens ("Skipping packages with conflicts") when trying to update other packages, so those two options have to be used then as well. This seems to have nothing to do with VirtualBox or RPM Fusion, so never mind.

I'm a bit confused that the VirtualBox kernel modules weren't built automatically on reboot, VirtualBox complained that they were missing. Running akmods manually worked though. This should always work automatically without user intervention. It's very inconvenient that VirtualBox does not work after every other system update and some command has to be run manually, even though it's automated. But /var/log/messages does not have any entries containing "akmods" on that day (it does on other days), so I may not have enough information to debug this.
Comment 5 Sérgio Basto 2016-08-04 14:51:38 CEST
http://rpmfusion.org/Howto/VirtualBox#Upgrade_VirtualBox_version_without_reboot

on reboot , may haven't time because to build it in less of 90 seconds , o systemd kills the process , I'm aware of the problem , maybe the best is run : 

akmods-shutdown

before reboot to build all kmods for all kernel
Comment 6 Basic Six 2016-08-04 15:46:59 CEST
Thanks for the tip.
Side note: On this system, it seems to be sufficient to run "sudo dnf install VirtualBox kernel-devel" (it says that the packages for the installed kernel versions are already installed). Changing "install" to "update" and adding "uname -r" makes dnf pull the latest kernel-devel version, not the one for the currently running kernel.

Good that you're aware of the problem. Just think about "regular" users (those who won't use the command line). They won't be able to fix this by running akmods manually. For them, VirtualBox will effectively be broken after every other system update. I don't think this happens on any other platform than Linux.