11

Kernel module build resulted in an error

Skipping BTF generation [my module name] due to unavailabilty of vmlinux.

This operation worked fine in my previous 20.10 version of Ubuntu with kernel 5.8.0.55*. I recently updated to Ubuntu version 21.04 -- and my kernel module build gave this error.

3 Answers 3

14

This worked for me on ubuntu 22.04. I no longer get the error 'Skipping BTF generation...'.

apt install dwarves
cp /sys/kernel/btf/vmlinux /usr/lib/modules/`uname -r`/build/

Of course, you first have to check that your vmlinux is indeed in /sys/kernel/btf.

1
  • thanks, even though I'm not really what is the underlying reason for this warning.
    – YCN-
    Dec 1, 2022 at 9:58
6

OK, this is sort of the answer.

Previously a start of any Virtual Machine under my Ubuntu 21.10 failed. The problem from VMWare's perspective was

Could not open /dev/vmmon: No such file or directory.

Please make sure that the kernel module `vmmon' is loaded.

(and vmnet also)

This command: sudo vmware-modconfig --console --install-all gave this error (and still does!)

Skipping BTF generation for /tmp/modconfig-9O1P2c/vmmon-only/vmmon.ko due to unavailability of vmlinux

SOLUTION

  • In my situation I was making a move of a Virtual machine from a Windows platform to a Ubuntu laptop installed with secure boot

  • Although the above compilation was not perfect it WAS CREATING the necessary binaries, but because they are not signed they cannot be loaded at Ubuntu boot time

  • So I got the BTF error messages that I thought was preventing VMNware to start but I was wrong.

  • This link https://github.com/mkubecek/vmware-host-modules/issues/87#issuecomment-800051833 explains the torture necessary to sign the binaries

    # generate a key
    openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/"
    # import to UEFI database
    sudo mokutil --import MOK.der     (generate a password need next step)
    # reboot system and import in UEFI BIOS
    # (use same password)
    sudo shutdown -r now
    
    # once rebooted need to sign the binaries
    sudo kmodsign sha256 ./MOK.priv ./MOK.der $(modinfo -n vmmon)
    
    sudo kmodsign sha256 ./MOK.priv ./MOK.der $(modinfo -n vmnet)
    # on reboot new signed binaries used
    sudo shutdown -r now
    # now good to start VMware and use any VM
    
  • Once the UEFI BIOS is informed and the driver binaries signed then VMware can operate fine and the world is saved again


So I did not totally fix the compilation issue, but it seems I was conflating this error message with the inability of VMware to run, which was wrong.

1
  • a very helpful answer. works for most of the cases if vmmon/vmnet has failed to be loaded because of the sign Oct 15 at 20:06
1

They changed the location of the file 'vmlinux.xz'

try ln -sf /usr/lib/modules/$(uname -r)/vmlinux.xz /boot/

Here is a reddit post that goes in a bit more detail

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .