Module build dkms kernel 5.16 fails VirtualBox

The install of the kernel module for virtualbox for kernel 5.16.2 failed on my machine. The dkms install returns a build error. It seems? to be an authorization issue??

The following packages will be installed:
linux516
linux516-headers


Starting
resolving dependencies...
looking for conflicting packages...
Packages (2) linux516-5.16.2-1  linux516-headers-5.16.2-1
Total Download Size:   140.69 MiB
Total Installed Size:  256.74 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
linux516-5.16.2-1-x86_64 downloading...
 linux516-headers-5.16.2-1-x86_64 downloading...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing linux516...
Optional dependencies for linux516
    crda: to set the correct wireless channels of your country [installed]
installing linux516-headers...
:: Running post-transaction hooks...
(1/5) Arming ConditionNeedsUpdate...
(2/5) Updating module dependencies...
(3/5) Install DKMS modules
==> dkms install --no-depmod vboxhost/6.1.30_OSE -k 5.16.2-1-MANJARO
Error! Bad return status for module build on kernel: 5.16.2-1-MANJARO (x86_64)
Consult /var/lib/dkms/vboxhost/6.1.30_OSE/build/make.log for more information.
==> WARNING: `dkms install --no-depmod vboxhost/6.1.30_OSE -k 5.16.2-1-MANJARO' exited 10
(4/5) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux516.preset: 'default'
-> -k /boot/vmlinuz-5.16-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.16-x86_64.img
==> Starting build: 5.16.2-1-MANJARO
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [autodetect]
-> Running build hook: [modconf]
-> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
-> Running build hook: [keyboard]
-> Running build hook: [keymap]
-> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.16-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux516.preset: 'fallback'
-> -k /boot/vmlinuz-5.16-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.16-x86_64-fallback.img -S autodetect
==> Starting build: 5.16.2-1-MANJARO
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [modconf]
-> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: xhci_pci
-> Running build hook: [keyboard]
-> Running build hook: [keymap]
-> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.16-x86_64-fallback.img
==> Image generation successful <cut>

and below output of the terminal with my user account shows that make and uname are installed.

❯ cat /var/lib/dkms/vboxhost/6.1.30_OSE/build/make.log 
DKMS make.log for vboxhost-6.1.30_OSE for kernel 5.16.2-1-MANJARO (x86_64) 
Mon Jan 24 14:01:55 CET 2022 
make: Entering directory '/usr/lib/modules/5.16.2-1-MANJARO/build' 
make: uname: No such file or directory 
make: make: No such file or directory 
make: *** [Makefile:1846: /var/lib/dkms/vboxhost/6.1.30_OSE/build] Error 127 
make: Leaving directory '/usr/lib/modules/5.16.2-1-MANJARO/build' 
❯ uname 
Linux 
❯ make 
make: *** No targets specified and no makefile found.  Stop. 

This happened with previous new kernels too and was worked around. Now help to solve this better is appreciated. Thanks! [update: I have selected the “solution” below, because it does the job (thanks!!) ]

DKMS is only required when there are no modules provided and need to be build.

sudo pacman -S linux516-virtualbox-host-modules

dkms is called by the 5.16 kernel install script, not by me. See step 3/5. And dkms is installed. So why does it fail?

Since you have moved to 5.16 have you tried to reinstall dkms and see if it builds.

Thanks, but no I have not tried that. It sounds like a workaround. As I understand it, the whole point of the way Manjaro installs a new kernel, is that required kernel modules are included automatically, or am I missing something?

For VirtualBox in Linux I have always found that having DKMS installed, and the header files for the kernel will usually be enough to keep things plugging along during kernel updates.

Now, VirtualBox is a fine product, used it for many years, and if on Windows or Mac, a great free tool to use. But if you are already running Linux, I will highly recommend trying out Virt-Manager, I have a tutorial here: Virtual Machine Manager w/UEFI support - DeLinuxCo

I think you will find a nice performance boost versus VirtualBox.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.