VirtualBox kernel modules

Warren Block wblock at
Tue Jan 15 01:36:17 UTC 2013

On Fri, 11 Jan 2013, Bernhard Fröhlich wrote:
> On Fri, Jan 11, 2013 at 4:19 PM, Brandon Gooch
> <jamesbrandongooch at> wrote:
>> On Thu, Jan 10, 2013 at 10:31 PM, Warren Block <wblock at> wrote:
>>> On Thu, 10 Jan 2013, Ryan Stone wrote:
>>>  As I recall, a make installkernel will first mv /boot/kernel
>>>> /boot/kernel.old
>>>> Should ports put modules in /boot/modules to avoid this kind of thing?
>>> I thought so, but the Porter's Handbook doesn't say anything about it.
>>> multimedia/cuse4bsd-kmod installs a module there.
> I think this is an unwanted side effect. In fact I changed the defintion of
> where the kernel module should be installed in virtualbox-ose-kmod/Makefile
> from KMODDIR=/boot/modules to KMODDIR?=/boot/modules to allow
> overwriting the KMODDIR in case you want to have a non default directory
> for your kernel modules (like in a jail).
> I haven't found yet where KMODDIR is set to /boot/kernel but it obviously is
> defined somewhere. I'm also not sure if that is really a virtualbox
> problem or if
> we better should fix that in Mk and set KMODDIR or create a new variable for
> ports kernel modules.
> In the meantime overwriting KMODDIR to /boot/modules in your make.conf
> should help.

Except that if you set KMODDIR=/boot/modules, then all the OS kernel 
modules are put there also.  And building or installing the kernel still 
wipes out that directory and the Virtualbox modules.

More information about the freebsd-emulation mailing list