Re: linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Sun, 07 May 2023 05:57:42 UTC
On Sat, May 6, 2023 at 9:47 PM Steven Friedrich <freebsdlouisville@gmail.com>
wrote:

> On a fresh install of freebsd 13.2 (I did make a new kernel, but I'm
> running GENERIC for this.
>
> I used pkg install to get virtualbox-ose.  When I try to load the
> vboxdrv.ko, I get this error:
>
> KLD vboxdrv.ko: depends on kernel - not available or version mismatch
> linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type
>
> FreeBSD freebsd.friedrich.org 13.2-RELEASE FreeBSD 13.2-RELEASE
> releng/13.2-n254617-525ecfdad597 GENERIC amd64
>

And here we go again...

The packages are built on 13.1-RELEASE which means the package will not
load on 3.2. You need to have a system with the 3.2
kernel sources and then build the .ko on that system. It does not need to
be the system it is to be run on, but must be an amd64 processor. The
resulting package may be installed on any other 13.2 amd64 system.

To build the package, get the sources for the kernel on the build system.
Then:
cd /usr/ports/emulators/virtualbox-ose-kmod
pkg install kBuild (if not already installed)
pkg install llvm14 (if not already installed)
make package (if you want to install on another system)
make install (on the system you need it on)

In the last status report, this issue was being addressed, so  I am hopeful
that this is the last time the issue will show up, but no promises. In any
case, the builds will be done on 13.2 when 13.1 goes EOL.
-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683