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

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Sun, 07 May 2023 14:32:33 UTC
On Sun, May 7, 2023 at 2:43 AM Steven Friedrich <freebsdlouisville@gmail.com>
wrote:

> On 5/7/23 1:57 AM, Kevin Oberman wrote:
> > 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 <http://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
>
> Thank you, Kevin.  I just finished buildworld, build kernel,
> installkernel, and installworld.
>
> I just built/installed the virtualbox-ose-kmod port.
>
> Can I just rebuild/install the kernel?
>
> --
> FreeBSD freebsd.friedrich.org 13.2-RELEASE FreeBSD 13.2-RELEASE
> releng/13.2-n254617-525ecfdad597 GENERIC amd64
>

You are working too hard!
There is no need to rebuild anything except emulators/virtualbox-ose-kmod.
The system and kernel are fine. You just need to build the kmod against the
13.2 kernel sources. Since you have the sources on the system, all that was
required was to reinstall the virtualbox-ose-kmod port. no new kernel is
required. The port will install the kernel modules into /boot/modules and
they are ready to load either with a reboot or using kldload.


-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683