VirtualBox fails to build drivers for kernel 4.4.172
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
VirtualBox fails to build drivers for kernel 4.4.172
I just upgraded to the new kernel release 4.4.172 (for slackware64 14.2) and now VirtualBox is unable to build the kernel drivers.
I tried just rebuiling using the VirtualBox I had already installed (Version 5.1.14 r112924), and I get this error:
tail /var/log/vbox-install.log:
Code:
if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/threadctxhooks-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/tmp/vbox.0/r0drv/linux/threadctxhooks-r0drv-linux.o"; fi; fi;
if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/time-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/tmp/vbox.0/r0drv/linux/time-r0drv-linux.o"; fi; fi;
if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/SUPDrvTracer.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/tmp/vbox.0/SUPDrvTracer.o"; fi; fi;
if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/SUPDrvGip.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/tmp/vbox.0/SUPDrvGip.o"; fi; fi;
if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/timer-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/tmp/vbox.0/r0drv/linux/timer-r0drv-linux.o"; fi; fi;
if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/SUPDrv.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount "/tmp/vbox.0/SUPDrv.o"; fi; fi;
Makefile:1436: recipe for target '_module_/tmp/vbox.0' failed
make[1]: *** [_module_/tmp/vbox.0] Error 2
Makefile:303: recipe for target 'vboxdrv' failed
make: *** [vboxdrv] Error 2
I then dowloaded the latest VirtualBox 6.0.4 r128413 (released Jan 28) but get exactly the same error... any ideas?
This is my first post to Slackware community, so hello to everyone and please excuse me if something goes wrong!
I'm using Slackbuild's virtualbox build on 14.2 and after upgrade to kernel 4.4.172 it has stopped working.
I've tried to rebuild virtualbox-kernel package but with no success.
Thanks to montagdude's link above and bormant's fix there I was able to fix the Slackbuild's script.
I've built successfuly Slackbuild's 5.0.40 virtualbox-kernel package on 4.4.172 kernel and I'm running it without troubles at the moment.
If anyone interested, I attach my patches here.
kernel-4.4-build-168-and-newer.diff :
Code:
--- memobj-r0drv-linux.c.orig 2019-02-01 09:08:53.000000000 +0100
+++ memobj-r0drv-linux.c 2019-02-01 09:21:42.058771069 +0100
@@ -1087,7 +1087,7 @@
pTask->mm, /* Whose pages. */
R3Ptr, /* Where from. */
cPages, /* How many pages. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
fWrite ? FOLL_WRITE | /* Write to memory. */
FOLL_FORCE /* force write access. */
: 0, /* Write to memory. */
After downloading VirtualBox-6.0.4 source from Oracle, I've been searching for
the file location to apply the patch.
I've also downloaded, and run VirtualBox-6.0.4-128413-Linux_amd64.run
Searching the file: VirtualBox-6.0.4/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
and the file: /usr/src/vboxhost-6.0.4/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
Anyway. I found 3 of "if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0)"
and changing those to "if GET_USER_PAGES_API >= KERNEL_VERSION(4, 4, 168)"
made the drivers compile
I installed the binary and after it failed compiling the drivers, I applied the patch:
Code:
--- memobj-r0drv-linux.c.orig 2019-02-01 09:08:53.000000000 +0100
+++ memobj-r0drv-linux.c 2019-02-01 09:21:42.058771069 +0100
@@ -1087,7 +1087,7 @@
pTask->mm, /* Whose pages. */
R3Ptr, /* Where from. */
cPages, /* How many pages. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
fWrite ? FOLL_WRITE | /* Write to memory. */
FOLL_FORCE /* force write access. */
: 0, /* Write to memory. */
Code:
cd /opt/VirtualBox/src/vboxhost/vboxdrv/r0drv/linux
patch < patch1
But this does not work with the most recent VirtualBox 6.0.4-128413. For that one I followed the hack suggested by trasherdk and that worked. But since I don't really understand the code or the kernel change, I would prefer a more authoritative solution!
This is my first post to Slackware community, so hello to everyone and please excuse me if something goes wrong!
I'm using Slackbuild's virtualbox build on 14.2 and after upgrade to kernel 4.4.172 it has stopped working.
I've tried to rebuild virtualbox-kernel package but with no success.
Thanks to montagdude's link above and bormant's fix there I was able to fix the Slackbuild's script.
I've built successfuly Slackbuild's 5.0.40 virtualbox-kernel package on 4.4.172 kernel and I'm running it without troubles at the moment.
If anyone interested, I attach my patches here.
kernel-4.4-build-168-and-newer.diff :
Code:
--- memobj-r0drv-linux.c.orig 2019-02-01 09:08:53.000000000 +0100
+++ memobj-r0drv-linux.c 2019-02-01 09:21:42.058771069 +0100
@@ -1087,7 +1087,7 @@
pTask->mm, /* Whose pages. */
R3Ptr, /* Where from. */
cPages, /* How many pages. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
fWrite ? FOLL_WRITE | /* Write to memory. */
FOLL_FORCE /* force write access. */
: 0, /* Write to memory. */
should there not be an # endif line in the patch to close the +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) line ?
No, because the #endif is already in the source file (memobj-r0drv-linux.c). The patch only includes the changes and some (default to 3) lines before and after the context. Guess that the "# endif" would be visible (in the lines after the context) in the patch if "diff" was run with --context=10.
There's no way kernel gets upgraded in -stable for major version.
willysr,
it has been upgraded to version with changed API. De facto minor or major kernel version have to be changed for those istead of patchlevel increment in 4.4.168+. While 4.4.172 has 4.4 version, 3rd party software uses conditional compile paths for 4.9 to conform "new 4.4" API now.
And when breaking changes is already here why not to use 4.9 or 4.14 -- for those 3rd party software knows about those API and conditional compile paths.
And if numbers is the only true target not content may be 4.14 kernel in testing/ is a good enough for now.
Code:
( cd /var/log/packages ; ls kernel-* )
kernel-generic-4.14.97-x86_64-1 kernel-headers-4.4.172-x86-1 kernel-modules-4.14.97-x86_64-1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.