I can't install VirtualBox on FreeBSD 13

Hello,
this is a bit frustrating, I spent more thant 24 hours reading and trying to install VirtualBox in different ways (packages, ports...) but nothing.

I found this website (https://freebsdfoundation.org/resource/using-freebsd-as-a-virtual-host-quick-guide/) and I have an error on the second step (the second!!!).

When I write kldload vboxdrv it says: kldload: an error occurred while loading module vboxdrv. Please check dmesg(8) for more details.

I have FreeBSD 13 amd64.
I installed the package virtualbox-ose and I checked (pkg info virtualbox-ose) and it is for architecture amd64, so everything should work fine.

Could somebody send me a step by step tutorial, please?
 

Attachments

  • captura (1).png
    captura (1).png
    4.1 KB · Views: 59
What is the exact version of FreeBSD? I mean the output of freebsd-version -uk.
It should have worked by ports in all cases. Have you updated your ports tree?
 
What is the exact version of FreeBSD? I mean the output of freebsd-version -uk.
It should have worked by ports in all cases. Have you updated your ports tree?
13.2-RELEASE

It's a clean installation of FreeBSD.
I'm going to reinstall it, from zero, and just download and compile /usr/ports/emulators/virtualbox-ose right now.
 
I'm going to reinstall it, from zero,
There's no need for this. This isn't Windows.

When I write kldload vboxdrv it says: kldload: an error occurred while loading module vboxdrv. Please check dmesg(8) for more details.
Well, did you actually look at what dmesg(8) says? In other words, check the logs, specifically /var/log/messages and see why it failed to load.
 
I've found that the package seems a bit out of date with the kernel. Sometimes, it's just the kmod. Did you also install, from ports, virtualbox-ose-kmod?
 
There's no need for this. This isn't Windows.


Well, did you actually look at what dmesg(8) says? In other words, check the logs, specifically /var/log/messages and see why it failed to load.
This is what says dmesg(8)

Weird, isn't it?
 

Attachments

  • dmesg8.png
    dmesg8.png
    3.2 KB · Views: 82
This is what says dmesg(8)
The (8) isn't part of the command. It's to indicate the section of the man pages; in this case section 8; FreeBSD System Manager's Manual. See man(1) and learn how to use it. You're going to need to learn how to read manual pages, you will be needing them, a lot.
 
The (8) isn't part of the command. It's to indicate the section of the man pages; in this case section 8; FreeBSD System Manager's Manual. See man(1) and learn how to use it. You're going to need to learn how to read manual pages, you will be needing them, a lot.
Yes, sorry :) :) :) I thought I had to write dmesg(8). You are right, the manual is our best friend.
I'm now with /usr/ports/emulators/virtualbox-ose, I'll see how it finish my adventure... :)
 
Probably yes, thanks for the information. I'll try to compile from ports.
was compile virtualbox-ose-kmod on i5 2500 processor, more than 5 hours and no sign going to finish.
could anyone make correct guidelines for building virtualbox from ports, please ? :), and why virtualbox pkg install failing ? (kldload vboxdrv kernel mismatch problem)..

i need virtualbox for winbox container.

thanks for any guidance and helps. :)
 
was compile virtualbox-ose-kmod on i5 2500 processor, more than 5 hours and no sign going to finish.
It's probably building a whole bunch of build dependencies now. Hint: make install-missing-packages.

Code:
     Example 2: Installing Dependencies with pkg(8)

       The following example shows how to build and install a port without
       having to build its dependencies.  Instead, the dependencies are
       downloaded via pkg(8).

         # make install-missing-packages
         # make install

       It is especially useful, when the dependencies are costly in time and
       resources to build (like lang/rust).  The drawback is that pkg(8)
       offers only packages built with the default set of OPTIONS.
ports(7)

and why virtualbox pkg install failing ? (kldload vboxdrv kernel mismatch problem)..
Because packages are still being built for 13.1-RELEASE and you have 13.2-RELEASE. When 13.1 is EoL (end of this month) packages will start to be built for 13.2. This version difference is only relevant for a handful of ports, specifically ones that build kernel modules. For 99.9% of the other packages it's not a problem to install 13.1 packages on 13.2.
 
i5 not powerful enough for such compiling task..
Nonsense. This is my "build" server:
Code:
Jan  7 19:23:10 molly kernel: CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (3192.83-MHz K8-class CPU)
Jan  7 19:23:10 molly kernel:   Origin="GenuineIntel"  Id=0x306a9  Family=0x6  Model=0x3a  Stepping=9
Jan  7 19:23:10 molly kernel:   Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Jan  7 19:23:10 molly kernel:   Features2=0x7fbae3ff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
Jan  7 19:23:10 molly kernel:   AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
Jan  7 19:23:10 molly kernel:   AMD Features2=0x1<LAHF>
Jan  7 19:23:10 molly kernel:   Structured Extended Features=0x281<FSGSBASE,SMEP,ERMS>
Jan  7 19:23:10 molly kernel:   XSAVE Features=0x1<XSAVEOPT>
Jan  7 19:23:10 molly kernel:   VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
Jan  7 19:23:10 molly kernel:   TSC: P-state invariant, performance statistics
Jan  7 19:23:10 molly kernel: real memory  = 17179869184 (16384 MB)
Jan  7 19:23:10 molly kernel: avail memory = 16449519616 (15687 MB)
It just takes longer to complete.
 
my friends,
the only reasonable reason for me to compile a package.. its just optimization, or features not included in already build pkg. im not so like developer tools cluttering on system. if it takes hours to compile in let say more than 4 hours, i rather wait packages from builders to complete.
 
im not so like developer tools cluttering on system.if it takes hours to compile in let say more than 4 hours,
make install-missing-packages will install those. And they're easily removed when you're finished with pkg autoremove.

i rather wait packages from builders to complete.
Sure, but that's going to take even longer, packages for 13.2 won't be built until next month.
 
late reply looking for alternative,
so bhyve wont run on non uefi or older windows os,
and wine works but you cant turn it off and make easy isolation..

following sir dice advice,
make-install-missing-packages
copy and extract src.txz from usb installer to /usr/src
and make fastly compile under 10 minutes finished, and after download a few packages.
Wow that very fast.. *wowwow, the previous compiling process take hours to complete.... :D

then load new modules,
import .ova images,
and successfully running virtualbox (non root) with few non fatal problem..

Code:
Jul 15 09:21:53 freebsd13 kernel: warning: KLD '/boot/modules/vboxnetflt.ko' is newer than the linker.hints file
Jul 15 09:21:53 freebsd13 kernel: warning: KLD '/boot/modules/vboxnetadp.ko' is newer than the linker.hints file

and on xfce send notify

Code:
vboxclient : The virtualbox kernel is not running, existing..

actually run ..

great, thanks :)
 
It should with CSM firmware if you have sysutils/uefi-edk2-bhyve-csm installed (will be installed as dependency of sysutils/bhyve-firmware with default options). You need to change the firmware VM is using to /usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd.
It should, but personally, I never succeeded to boot anything with that CMS firmware. bhyve-grub runs well for legacy boot of a linux OS. You have /usr/share/examples/bhyve/vmrun.sh for FreeBSD. Out of this, BHYVE_UEFI.fd is ok for all UEFI aware OSes.

Concerning the OP'problem, read carefully this: https://forums.freebsd.org/threads/freebsd-13-2-and-virtualbox-ose.88747/

Compilation of emulators/virtualbox-ose-kmod takes one minute - not ten - if all dependencies were previously installed thanks to pkg.
 
Back
Top