diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 6cfba69e23c..6f5062545e4 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -103,7 +105,11 @@ vm_device_open(const char *name) int vm_create(const char *name) { - + /* Try to load vmm(4) module before creating a guest. */ + if (modfind("vmm") < 0) { + if (modfind("vmm") < 0) + kldload("vmm"); + } return (CREATE((char *)name)); }