Re: VirtualBox kmod won't load "module already loaded or in kernel" (SOLVED)

From: Graham Menhennitt <graham_at_menhennitt.com.au>
Date: Sat, 20 Jul 2024 02:55:07 UTC
Indeed! I have built the port and it's now working. It's a pain building 
as you need kernel source installed and it has lots of dependencies

As you say, it's not necessary to build virtualbox-ose to fix it. 
However, I did need to build that in order to fix 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270900 to get USB 
working. That's even more of a pain as it depends on lots more things 
including llvm14. Again, I now have it all working including the USB 
pass-through. I'll ask on the mailing list for somebody to commit the 
(one line) fix for that bug.

Thanks again, Greg.

Graham

On 19/07/2024 1:37 pm, Greg 'groggy' Lehey wrote:
> On Friday, 19 July 2024 at 13:23:46 +1000, Graham Menhennitt wrote:
>> Hello all,
>>
>> I'm running FredBSD 14.1 amd64 with a GENERIC kernel. I've installed
>> VirtualBox from packages. But I can't load any of its kmod modules. When I
>> try, I get a message:
>>      # kldload vboxdrv
>>      kldload: can't load vboxdrv: module already loaded or in kernel
>>      #
>> However, neither of those things is true:
>>      # kldstat -v|grep -i virtualbox
>>      #
> Yes.  It lies.  It's VB's inimitable way of saying "you have the wrong
> module version for this kernel".  It should be sufficient to rebuild
> the virtualbox-ose-kmod port.  Don't install the package, because it
> doesn't know what kernel you have.
>
> I also rebuilt virtualbox-ose, but that's quite a pain and I don't
> think it's necessary.  See
> http://www.lemis.com/grog/diary-jun2024.php?subtitle=Still%20more%20VirtualBox%20fun&article=D-20240630-002403#D-20240630-002403
> for more details.
>
> When you're done, 'kldload vboxnetadp' should be enough.  That will
> load the other modules.
>
> Greg
> --
> Sent from my desktop computer.
> See complete headers for address and phone numbers.
> This message is digitally signed.  If your Microsoft mail program
> reports problems, please read http://lemis.com/broken-MUA.php