Solved VirtualBox driver load failing


I have been having troubles installing VirtualBox from ports on my brand new FreeBSD 11 installation.

The problem is that after successful installation(even a couple of reboots) kldload vboxdrv fails with:

KLD vboxdrv.ko: depends on kernel - not available or version mismatch
linker_load_file: Unsupported file type

I tried re-compiling a couple of times with the following differences:

1. /usr/src at stable/11

2. Same as above but with the patches that come through from freebsd-update(fetch and then install)

3. /usr/src at HEAD

After each change I do

make deinstall
make install clean

but the result is always the same(even after a reboot).

My Hardware:
CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
RAM: 16GB(2x8GB Kingston Hyperx)(not sure which ones, can check if necessary)
HDD: 1TB Samsung 850 Evo
Graphics Card: Intel built-in(with SCFB driver).

I can't find anybody having a similar problem so it must be me doing something wrong and I don't know what else to try.

Also, as pointed out to me in this thread, ACPI related stuff are not working.

Could it be a conflict in between this and another module? I have bhyve installed but not loaded in the kernel:

Id Refs Address            Size     Name
 1  121 0xffffffff80200000 1fa7c38  kernel
 2    1 0xffffffff821a9000 30aec0   zfs.ko
 3    2 0xffffffff824b4000 adc0     opensolaris.ko
 4    1 0xffffffff824bf000 9b748    linux.ko
 5    3 0xffffffff8255b000 de28     linux_common.ko
 6    1 0xffffffff82569000 4008     snd_driver.ko
 7    2 0xffffffff8256e000 93f8     snd_vibes.ko
 8    2 0xffffffff82578000 7cd8     snd_via82c686.ko
 9    2 0xffffffff82580000 8958     snd_t4dwave.ko
10    4 0xffffffff82589000 2668     snd_spicds.ko
11    2 0xffffffff8258c000 ab38     snd_solo.ko
12    5 0xffffffff82597000 6138     snd_sbc.ko
13    2 0xffffffff8259e000 8330     snd_sb8.ko
14    2 0xffffffff825a7000 84e0     snd_sb16.ko
15    2 0xffffffff825b0000 15488    snd_neomagic.ko
16    3 0xffffffff825c6000 16e60    snd_mss.ko
17    2 0xffffffff825dd000 ef48     snd_maestro3.ko
18    2 0xffffffff825ec000 da40     snd_maestro.ko
19    2 0xffffffff825fa000 7780     snd_fm801.ko
20    2 0xffffffff82602000 acf8     snd_ess.ko
21    2 0xffffffff8260d000 d028     snd_envy24ht.ko
22    2 0xffffffff8261b000 e6d8     snd_envy24.ko
23    2 0xffffffff8262a000 102d0    snd_ds1.ko
24    2 0xffffffff8263b000 9170     snd_cs4281.ko
25    2 0xffffffff82645000 a648     snd_atiixp.ko
26    2 0xffffffff82650000 9318     snd_als4000.ko
27    2 0xffffffff8265a000 bca8     snd_ad1816.ko
28    1 0xffffffff82666000 4c60     coretemp.ko
29    1 0xffffffff8266b000 1a7c8    fuse.ko
30    1 0xffffffff82686000 12a38    tmpfs.ko
31    1 0xffffffff82ffa000 a9f1     linprocfs.ko
32    1 0xffffffff83005000 2a05     uhid.ko
33    1 0xffffffff83008000 3710     ums.ko
34    1 0xffffffff8300c000 587b     fdescfs.ko

Thank you in advance.
Don't use any of the /base/release directories. If you need the source for 11.0-RELEASE it's /base/releng/11.0.
To elaborate, the /base/release/ are mostly there for administrative reasons (if I recall correctly it has something to do with the way tags/branches work). Those are basically "frozen" in time and never updated. The /base/releng/ directories are the actually -RELEASE versions, these get errata and security fixes. At this time you'd get the sources for 11.0-RELEASE-p7. The releng moniker is bit of a relic from the past, it's short for RELease ENGineering. The old cvs tree used tags like RELENG_4_3 for example for 4.3-RELEASE.