Solved Virtualbox kernel module fails to load on FreeBSD 13.1-RELEASE

I guess I jinxed myself, although it had been working for me in 13.1, I did a pkg upgrade without paying attention to what was being upgraded and got the kernel error. I used a combination of fyamamoto's and mss_cyclist's advice, rebuilt the kmod (though I have pkg set to pull latest, not quarterly, but it failed to work, giving the kernel mismatch error and ran make reinstall. I had been going to install the entire vbox-ose from ports so this saved me time.
 
Hi all! This may not be the best or cleanest solution, but it's working for me, until package binary is upgraded:

1. Download SRC tree from this link, and expand on /usr/src:
https://download.freebsd.org/releases/amd64/13.1-RELEASE/src.txz

2. Install virtualbox-ose and virtualbox-ose-kmod from pkg
# pkg install virtualbox-ose virtualbox-ose-kmod

3. Build kernel module from this ports, but do not install, just build it:
# cd /usr/ports/emulators/virtualbox-ose-kmod
# make


4. Copy just built modules into /boot/modules and overwrite existing ones (installed from packages):
# cd
/usr/ports/emulators/virtualbox-ose-kmod/work/stage/boot/modules
# cp *.ko /boot/modules


You should have these three modules:
vboxdrv.ko
vboxnetadp.ko
vboxnetflt.ko

5. Regenerate hint files to avoid boot warning:
# kldxref /boot/modules/

Hope it helps!
Regards :)
Hi, I followed your guide, but when I try to start a VM, I get the following error:

Failed to open a session for the virtual machine [B]Debian[/B].

Failed to load R0 module /usr/local/lib/virtualbox/VMMR0.r0: Unable to locate imported symbol [B]'SUPR0FpuBegin'[/B] for module [B]'VMMR0.r0'[/B] (VERR_SYMBOL_NOT_FOUND).

Failed to load VMMR0.r0 (VERR_SYMBOL_NOT_FOUND).

[TABLE]
[TR]
[TD]Result Code: [/TD]
[TD]NS_ERROR_FAILURE (0x80004005)[/TD]
[/TR]
[TR]
[TD]Component: [/TD]
[TD]ConsoleWrap[/TD]
[/TR]
[TR]
[TD]Interface: [/TD]
[TD]IConsole {872da645-4a9b-1727-bee2-5585105b9eed}[/TD]
[/TR]
[/TABLE]

Does someone know how to solve this?
 
Yes. 6.1.36
As of today, VirtualBox is on the same version on Ports and Packages:

Code:
% pkg version -v | grep -i virtualbox
virtualbox-ose-6.1.36              =   up-to-date with index
virtualbox-ose-kmod-6.1.36         =   up-to-date with index

"Missing symbol" sounds like a version mismatch.

I would try:

1. Uninstall packages
2. Cleaning build on virtualbox-ose-kmod port ("# make clean")
3. Installing & building again as stated above. To avoid the manual copying you can do a "make reinstall" as stated by mss_cyclist
 
  • Thanks
Reactions: drr
As of today, VirtualBox is on the same version on Ports and Packages:

Code:
% pkg version -v | grep -i virtualbox
virtualbox-ose-6.1.36              =   up-to-date with index
virtualbox-ose-kmod-6.1.36         =   up-to-date with index

"Missing symbol" sounds like a version mismatch.

I would try:

1. Uninstall packages
2. Cleaning build on virtualbox-ose-kmod port ("# make clean")
3. Installing & building again as stated above. To avoid the manual copying you can do a "make reinstall" as stated by mss_cyclist
Thanks a lot! Solved!

I added a portsnap fetch update. Maybe this helped?
 
  • Like
Reactions: drr
With FreeBSD 13.0 reaching EOL last week, do we know when can we expect the binary package of emulators/virtualbox-ose-kmod to become available for FreeBSD 13.1 kernel?
Probably during this week.

Package building servers still building, see https://pkg-status.freebsd.org/, "Package Builds", assuming you are looking for amd64 packages, look for Ports/Jail "quarterly 131amd64" or "default 131amd64" for "latest" packages.
 
with more than 32k packages to build!
Yes, these are "fresh" builds, so start at 0. That takes a while. Even on the "beefy" machines they use in the build cluster.
 
Excuse my ignorance, but what happens to the packages listed on https://pkg-status.freebsd.org/builds?jailname=131amd64 under 'failed', 'skipped' and 'ignored'?
Maintainer of a 'failed' port is automatically notified their build failed. "Skipped" are ports that can't be built because a dependency failed to build. Ignored are usually ports that are marked "BROKEN". It's up to the port maintainers to fix the failing port builds.
 
  • Thanks
Reactions: drr

Quarterly has been building for 38 hours and is almost halfway. Latest is nearly done (after 62 hours) but there's still a few thousand packages to go.
The 131amd quarterly builders seemed to have finished.
But when I clear pkg cache, upgrade -f, I still get the September 1st file.

What am I thinking or doing wrong? Are these new builds not uploaded to the repository until the new quarterly lands in October? Or am I just too impatient and they will be on the repository in a few hours?
Never lived this close to the bleeding edge :)

thanks for pointing me in the right direction
simon
 
The 131amd quarterly builders seemed to have finished.
There are other builds still running. And everything needs to be synced to the package mirrors. The syncing alone can take quite a bit of time too.

Or am I just too impatient and they will be on the repository in a few hours?
Just give it a couple of days for the mirrors to catch up.
 
There are other builds still running. And everything needs to be synced to the package mirrors. The syncing alone can take quite a bit of time too.


Just give it a couple of days for the mirrors to catch up.
pkg's out. Admiral, if we go "by the book". like Lieutenant Saavik, hours could seem like days.
 
  • Like
Reactions: drr
I just had the exact same issue (originally by the OP)
after upgrading from 13.1 -> 13.2

What I understood - please correct me, if I'm wrong:
Some packages are not up-to-date, when a new FreeBSD version is released,
so you simply may wait some days, and do a pkg upgrade
or install the package by ports instead.

So I did what I understood from the first couple of posts:
pkg remove virtualbox-ose-kmod (which removes vb completely, of course)
Then
cd /usr/ports/emulators/virtualbox-ose/
make install clean
(more automatic: # yes | make ... )
and then
kldload vboxdrv
et voilà!
vb runs.

But first unload FreeBSD's bhyve kmod:
kldunload vmm
Don't know why, but as scottro pointed out in his first post,
in conflicts with vb.
(I had the same issue since I've first started with vb on FreeBSD.
Took me a while to get this.)

Until I start to dig into bhyve while using vb only,
I like to have it not automatically loaded,
so I tried to unset it in /boot/loader.conf:
Code:
#vmm_load="NO"
but it's still loaded
Something completely silly by me?
 
Ok, almost right, but I don't think you have to remove virtualbox-ose-kmod. You just have to build the kmod. So, all you should have to do is install virtualbox-ose-kmod from ports. It should automatically replace the existing package, and you don't have to reinstall virtualbox-ose itself from ports or package.

As for the vmm module, I don't load it at boot. I *think* (but can't say I've really investigated, because I use neither VirtualBox nor bhyve very much), but I've also found the vmm module to loaded if I start bhyve. That is, if I've unloaded vmm to run VirtualBox, then I decide to run a bhyve machine, I just have to run
Code:
vm start <bhyve machine>
and the vmm module has loaded.

Now all this is without having loaded it at boot. Just starting a bhyve instance (in my case, I use vm-bhyve), seems to load the module. Next time I reboot, I'll check if it's loaded at boot.

Anyway, the important thing is that all you have to do is install virtualbox-ose-kmod from ports, and you can leave existing virtualbox-ose and the existing virtualbox-ose-kmod alone. Install the port, which is very quick, will update the kernel module. Installing virtualbox-ose itself from the port, takes quite awhile.
 
I'll check if it's loaded at boot.
Do this.
I'm pretty sure it will be loaded,
because I added the mentioned line above in my loader.conf to avoid to automatic loading - still loaded.

It's no big deal.
It's only inconvenient every time I want to start vb login as root and unload the vmm.

Installing virtualbox-ose itself from the port, takes quite awhile.
yupp.
The deinstalling of the packages was done in seconds.
Building VB from ports lasted about 20...30 min on my machine.
(Wish I'd used the 'yes' option; some enter keys were to hit.)
😂

But it works now.
(Thanks to this thread!)

I just ment my last post to be a summary,
because i by myself faced both of the problems treated here.
 
My apologies. I *do* have the vm module loaded in /etc/rc.conf.d, not /etc/rc.conf. I am using the excuse that I was sleepy this morning and just didn't think of it.
However, what I have is
Code:
vm_enable="YES"
vm_dir="/jails/storage/"bhyve"
So, maybe what you need is vm_enable="NO" rather than vmm_load.
That's just a guess though, I haven't tried it.
 
No need for excuses.

Just checked:
Makes no difference.

But thanks anyway.
It's not a serious prob.

Thanks!
 
You must have set something peculiar in your system.
Yupp.
I just checked on another machine with FreeBSD pure vanilla:
no vmm loaded.
I'll have to dig for myself on that.

Thanks.
Sometimes I need a guide to see the trees in the woods. 😁
 
Back
Top