Bug 265956 - emulators/virtualbox-ose-kmod: vboxdrv will not load on 13.1-RELEASE
Summary: emulators/virtualbox-ose-kmod: vboxdrv will not load on 13.1-RELEASE
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Graham Perrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-20 14:06 UTC by d.a.pavlov
Modified: 2023-03-19 21:23 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description d.a.pavlov 2022-08-20 14:06:26 UTC
Freebsd 13.1 release amd64
current VirtualBox version*36 driver will fail to load, the port will also fail to compile, rendering virtualbox impossible to use on this release.

1. #kldload vboxdrv
will fail to load the driver

2. virtualbox message when trying to boot a virtualmachine

" Kernel driver not installed (rc=-1908)

Make sure the kernel module has been loaded successfully.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT. "
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2022-08-20 15:29:56 UTC
(In reply to d.a.pavlov from comment #0)

Hi,

Are you using official binary packages?

If so I guess this is a known issue.

> 1. #kldload vboxdrv
> will fail to load the driver

You should attach the error message you're getting, from the console or messages.

Anyway I guess the error message you get is that the module is incompatible with the installed kernel.

At present official binary packages are built against FreeBSD 13.0. This will change shortly after FreeBSD 13.0 EOLs (exp. on August 31st).

SO the official binary packages are expected to fail on 13.1. Only option at present is to compile the virtualbox-ose-kmod port yourself.

This is a known issue affecting all kmods in the ports tree.

SO, can you try building the kmod yourself and report back?

Thanks.
Comment 2 d.a.pavlov 2022-08-20 15:39:09 UTC
(In reply to Guido Falsi from comment #1)

I will try to compile it again from the ports, 6.1.32 is in the ports.
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2023-03-14 07:18:38 UTC
root@fuji:~ # grep vbox /etc/rc.conf
vboxdrv_load="YES"
vboxnet_enable="YES"
root@fuji:~ # 

Below, I use kldload only because the module is not loaded. 

(In reply to Guido Falsi from comment #1)

root@fuji:~ # kldload vboxdrv
kldload: an error occurred while loading module vboxdrv. Please check dmesg(8) for more details.
root@fuji:~ # dmesg | tail -n 3
linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type
KLD vboxdrv.ko: depends on kernel - not available or version mismatch
linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type
root@fuji:~ # pkg info -x virtualbox-ose
virtualbox-ose-6.1.36_1
virtualbox-ose-kmod-6.1.36
root@fuji:~ # freebsd-version -kru
13.1-RELEASE-p6
13.1-RELEASE-p6
13.1-RELEASE-p7
root@fuji:~ # uname -aKU
FreeBSD fuji 13.1-RELEASE-p6 FreeBSD 13.1-RELEASE-p6 GENERIC amd64 1301000 1301000
root@fuji:~ # 

FreeBSD repository, latest: 

root@fuji:~ # pkg -vv | grep -e url -e enabled -e priority
    url             : "pkg+http://pkg0.bme.freebsd.org/FreeBSD:13:amd64/latest",
    enabled         : yes,
    priority        : 4,
    url             : "file:///usr/local/poudriere/data/packages/thirteen-default",
    enabled         : yes,
    priority        : 3
root@fuji:~ # pkg info virtualbox-ose-kmod
virtualbox-ose-kmod-6.1.36
Name           : virtualbox-ose-kmod
Version        : 6.1.36
Installed on   : Wed Aug  3 04:27:03 2022 BST
Origin         : emulators/virtualbox-ose-kmod
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : kld emulators
Licenses       : GPLv2
Maintainer     : vbox@FreeBSD.org
WWW            : https://www.virtualbox.org/
Comment        : VirtualBox kernel module for FreeBSD
Options        :
        DEBUG          : off
        VIMAGE         : on
Annotations    :
        FreeBSD_version: 1300139
        cpe            : cpe:2.3:a:oracle:vm_virtualbox:6.1.36:::::freebsd13:x64
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 548KiB
Description    :
VirtualBox is a family of powerful x86 virtualization products for
enterprise as well as home use. Not only is VirtualBox an extremely
feature rich, high performance product for enterprise customers, it
is also the only professional solution that is freely available as
Open Source Software under the terms of the GNU General Public License.

WWW: https://www.virtualbox.org/
root@fuji:~ #
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2023-03-14 07:50:02 UTC
(In reply to Guido Falsi from comment #1)

2022-08-20: 

> At present official binary packages are built against FreeBSD 13.0. 
> This will change shortly after FreeBSD 13.0 EOLs (exp. on August 31st).

Is something now needed for pkg upgrade to get what's required? 

I worked around by building from source.
Comment 5 Guido Falsi freebsd_committer freebsd_triage 2023-03-14 08:10:39 UTC
(In reply to Graham Perrin from comment #4)

I'm sorry I'm not using VirtualBox anymore, so I don't have current information about its issues.

I see this in your log:

KLD vboxdrv.ko: depends on kernel - not available or version mismatch

it should mean the kernel was not compiled against the correct kernel sources.

thiis is confirmed by pkg output: "FreeBSD_version: 1300139", which indicates this pkg was compiled against 13.0, not 13.1

This is known, the latest packages ARE compiled on 13.0.

Building from source, in your case, is the only correct solution.

Apart from this I am unable to give you any more insight.



If you want to know I now use bhyve(8) for virtualization. YMMV.
Comment 6 Graham Perrin freebsd_committer freebsd_triage 2023-03-14 23:09:03 UTC
(In reply to Guido Falsi from comment #5)

> … the latest packages ARE compiled on 13.0.

Are you certain? See below, 1301000. 
 
> Building from source, in your case, is the only correct solution. …

I found a simpler workaround: _force_ an upgrade of the package from the FreeBSD repo. 

root@fuji:~ # pkg info virtualbox-ose-kmod
virtualbox-ose-kmod-6.1.36
Name           : virtualbox-ose-kmod
Version        : 6.1.36
Installed on   : Tue Mar 14 22:47:53 2023 GMT
Origin         : emulators/virtualbox-ose-kmod
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : kld emulators
Licenses       : GPLv2
Maintainer     : vbox@FreeBSD.org
WWW            : https://www.virtualbox.org/
Comment        : VirtualBox kernel module for FreeBSD
Options        :
        DEBUG          : off
        VIMAGE         : on
Annotations    :
        FreeBSD_version: 1301000
        cpe            : cpe:2.3:a:oracle:vm_virtualbox:6.1.36:::::freebsd13:x64
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 559KiB
Description    :
VirtualBox is a family of powerful x86 virtualization products for
enterprise as well as home use. Not only is VirtualBox an extremely
feature rich, high performance product for enterprise customers, it
is also the only professional solution that is freely available as
Open Source Software under the terms of the GNU General Public License.

WWW: https://www.virtualbox.org/
root@fuji:~ #
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2023-03-15 08:17:58 UTC
(In reply to Graham Perrin from comment #6)

> Are you certain? See below, 1301000. 

Maybe I misinterpreted the number, as I said, I'm not using VirtualBox anymore.

> I found a simpler workaround: _force_ an upgrade of the package from the FreeBSD repo. 

Then it is not a workaround, simply the package was recreated without a PORTREVISION bump, which is what could happen in this case.

Anyway if this is fixed please close the issue.
Comment 8 Graham Perrin freebsd_committer freebsd_triage 2023-03-19 21:23:36 UTC
There's a documentation issue, which is partly outlined in the second part of bug 270338 comment 3. 

Today, for example: 

root@fuji:~ # pkg iinfo virtualbox-ose-kmod
virtualbox-ose-kmod-6.1.36
root@fuji:~ # pkg info virtualbox-ose-kmod | grep Installed
Installed on   : Sun Mar 19 17:10:16 2023 GMT
root@fuji:~ # freebsd-version -kru ; uname -aKU
13.2-RC3
13.2-RC3
13.2-RC3
FreeBSD fuji 13.2-RC3 FreeBSD 13.2-RC3 releng/13.2-n254599-d9bf9d73203f GENERIC amd64 1302001 1302001
root@fuji:~ # kldstat | grep vb
root@fuji:~ # kldload vboxdrv
kldload: an error occurred while loading module vboxdrv. Please check dmesg(8) for more details.
root@fuji:~ # dmesg | tail -n 2
KLD vboxdrv.ko: depends on kernel - not available or version mismatch
linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type
root@fuji:~ # grep virtualbox /var/log/messages | grep Mar\ 19
Mar 19 17:10:17 fuji pkg-static[86078]: virtualbox-ose-kmod reinstalled: 6.1.36 -> 6.1.36 
Mar 19 17:13:55 fuji pkg-static[86078]: virtualbox-ose reinstalled: 6.1.36_1 -> 6.1.36_1 
root@fuji:~ # 

----

I'll continue in 270338. 

madpilot@ many thanks for your past work on the VirtualBox-related ports, and for occasional input/comments since you moved on :-)