Solved freebsd 13.2 and virtualbox-ose

there is probably a good solution like zirias began to elaborate.
I just spat some random thoughts about how "doing it right" might look like ... mainly to make the point that's a pretty complex thing and just not worth the effort for very few affected packages :-/
 
Yes, but if there is documentation, one can just say, nicely, or not depending upon their character, That problem is covered in <link-to-documentation> As it is, there will be pitfalls for these edge cases.
 
Please don't get me wrong, I practically started using this system and I'm used to update in a way of thinking that it will bring improvements and most of all some security fix.
Getting back to the kmod, I did try to build it... had time for dinner, watched the Champions League games and Mandalorian new episode and after 5 hours it wasn't yet completed with a high speed CPU fan.
You know this is an old laptop.
I think I will just wait for the fix... 3 months right?
Good I've a Linux backup.
 
Geting back to the kmod, I did try to build it... had time for dinner, watched the Champions League games and Mandalorian new episode and after 5 hours it wasn't yet completed with a high speed CPU fan.
It's a small port/package, it should be done quite quickly even on modest hardware. High speed fan is good, your CPU is probably at 100% usage, which is a good thing to happen when compiling. I wonder what's it's been doing the past 5 hours though. Just ctrl-C it to break it off. It's probably trying to build way too much other things (bunch of build dependencies maybe?).

What exactly did you tell it to do?
 
Getting back to the kmod, I did try to build it... [...] after 5 hours it wasn't yet completed.
Please show exactly what you did. My guess: either you built something else, or you didn't have all dependencies installed yet and ended up building them. (edit: there aren't any, so forget that ...) Building the kmods should be a matter of minutes on most machines.
 
Please show exactly what you did. My guess: either you built something else, or you didn't have all dependencies installed yet and ended up building them. (edit: there aren't any, so forget that ...) Building the kmods should be a matter of minutes on most machines.
According to FreshPorts it depends on devel/kBuild, which depends (always for building) on:
devel/gmake,
print/texinfo,
lang/gcc12,
devel/automake,
devel/autoconf,
devel/binutils.

This could explain the long build time.
 
Oh. Have to undo my striking out I guess ?

Yes, indeed. Would be wiser to pkg install this before building. It mislead me because none of these dependencies should ever be necessary for native FreeBSD kernel modules. But I guess the virtualbox kmod isn't exactly "native" FreeBSD code ?
 
Recommend doing pkg install -A gmake texinfo gcc12 automake autoconf binutils kBuild beforehand. You could also use make install-missing-packages but one of the build dependencies will cause it to spiral somewhat out of control and pull in a gazillion unneeded packages. Recommend adding the -A option to pkg-install(8) so these packages are all registered as "automatic". This makes it easy to remove them with pkg-autoremove(8) when you're done.
 
Nice tip with the -A flag! But I think just installing kBuild should be enough as it depends on all that other stuff anyways?
 
But I think just installing kBuild should be enough as it depends on all that other stuff anyways?
Probably, but it won't hurt to explicitly install them, especially with the added -A flag.
 
I did a
cd /usr/ports/emulators/virtualbox-ose-kmod
sudo make clean deinstall reinstall

yes seems to be building dependencies
aborted and trying again with dependencies installed already.
got this
make[4]: "/usr/share/mk/bsd.sysdir.mk" line 15: Unable to locate the kernel source tree. Set SYSDIR to override.
I believe I need the kernel source too, makes sense.
 
Rebuild kmod but now got
VBoxManage: error: Failed to load R0 module /usr/local/lib/virtualbox/VMMR0.r0: Unable to locate imported symbol 'SUPR0FpuBegin' for module 'VMMR0.r0' (VERR_SYMBOL_NOT_FOUND).
VBoxManage: error: Failed to load VMMR0.r0 (VERR_SYMBOL_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

pkg version -v | grep -i virtualbox
virtualbox-ose-6.1.36_1 > succeeds port (port has 6.1.32_2)
virtualbox-ose-kmod-6.1.32_1 = up-to-date with port
 
Rebuild kmod but now got
VBoxManage: error: Failed to load R0 module /usr/local/lib/virtualbox/VMMR0.r0: Unable to locate imported symbol 'SUPR0FpuBegin' for module 'VMMR0.r0' (VERR_SYMBOL_NOT_FOUND).
VBoxManage: error: Failed to load VMMR0.r0 (VERR_SYMBOL_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

pkg version -v | grep -i virtualbox
virtualbox-ose-6.1.36_1 > succeeds port (port has 6.1.32_2)
virtualbox-ose-kmod-6.1.32_1 = up-to-date with port
Just update your ports collection portsnap fetch update.
 
I upgraded a PC from 13.1 to 13.2. The nvidia video driver worked as it was (nvidia-modeset).

But I got the same problem as rmomota with virtualbox. I follow the advice of SireDice ( pkg install the build dependencies) and did make reinstall of emulators/virtualbox-ose-kmod with ports. And yes, I updated the ports before.

The compilation took one minute or so and it works perfectly.

BUT... Before that, I tried to compile emulators/virtualbox-ose without installing build dependencies... I stopped after one hour, when I read this thread. So, if you don't know exactly how to do, or don't ask the question to someone like SireDice, it's nearly impossible or at least too long for a mortal life.
 
Well, issue resolved.
I'm not sure if I did it the right way but I had to:
$ mv /usr/src /usr/src.bck
$ git clone --branch releng/13.2 https://git.FreeBSD.org/src.git /usr/src
$ mv /usr/ports /usr/ports.bck
$ git clone https://git.freebsd.org/ports.git /usr/ports
$ cd /usr/ports/emulators/virtualbox-ose-kmod
$ make clean deinstall reinstall

and that's it
I'm not sure if this was the correct way to update ports but it worked.

Yes, I had to install build dependencies before 'make'.
 
Maybe something to add:
pkg lock virtualbox-ose-kmod

And remember to unlock when packages will be compiled on 13.2.
 
Maybe something to add:
pkg lock virtualbox-ose-kmod

And remember to unlock when packages will be compiled on 13.2.
If I lock the package it will not get updates, I mean, I'm believing that the next version will be compiled for version 13.2.
Am I wrong?
 
Known problematic ports are specifically ones that install kernel modules like the kernel module for Virtualbox. This is a known issue (it almost always happens with every new minor version upgrade) but it always seems to catch people by surprise.
How hard would it be for pkg to check this OS version dependency and print out a message (in case the host version is different than the one expected)? Ideally with a one liner the user can cut-n-paste to build from ports. Of course, this would likely need adding yet another thing to the port system that pkg can rely on.
 
So I will I ever know ahead if 13.1 or 13.2 version?
13.2 was released yesterday (11 April), so until 11 July 13.1 will still be the default one for pkgs builds. However, Virtualbox (according to its commit history) doesn't get updates too often, just every ~3 month. You shuold be fine for the time being.
 
How hard would it be for pkg to check this OS version dependency and print out a message (in case the host version is different than the one expected)?
It does, it complains if the packaged OS version is newer than what you have installed.
 
I would even go as far as this: If it wasn't for drm-kmod being removed from base (IIRC in 11? IIRC for licensing reasons?), not even desktop users would typically ever notice the problem at all. Let's see when drm-kmod can be back in base...
Is a comeback of drm-kmod in base actually planned/wanted by the developers? I thought it was moved to ports so that support for newer graphics hardware could be made available without users having to wait for the next stable release, which is a positive change. On the other hand, it's true that these three months of incompatibility are a bit annoying, sometimes you'd prefer not to need the ports collection and be able to rely on packages only (some people will even label as heresy any local build from ports on a system using packages...), in this case you're forced to stick with the previous release until its very end of life.

I am a bit jealous of OpenBSD users on that matter, they must have a strong team working on GPU support because their AMD and Intel drivers are part of the base system and yet are always more up to date than the FreeBSD ones. The freshly released OpenBSD 7.3 comes with drivers matching Linux 6.1.15...
 
We could do what Linux distributions do. Have binary packages that can optionally compile things on install.

That is how you get ZFS or NVidia drivers on Linux. If the kernel or the target package change, then the kernel module is recompiled.

Of course it increases the risk that something goes wrong during a binary pkg update and holds up the whole show.

Just mentioning it here. Personally I don't think that the FreeBSD's kernel API changes often enough to warrant such a system, but it is an option without importing the whole shebang into the base system.
 
Back
Top