User Tools

Site Tools


Kume's Wiki



FreeBSD 12.0 As VirtualBox 5.x Host


  • OS FreeBSD 12.0
  • VirtualBox version 5.x : pkg install
  • H/W : i5 + 16GiB-MEM + 4@1TiB-HDD=RAIDZ1(3TiB)

Installing Operating System

  • Install from CD1 ( I used ZALMAN CD-IMAGE Mounter )
  • Add a user for VB-startup as adminvb besides root
  • Basic preparation
# freebsd-update fetch
# freebsd-update install
# pkg update
# pkg install joe            # I as a old-man use wordstar-like editor
# joe /etc/ssh/sshd_config   # PermitRootLogin yes
# dmesg | grep Serial        # Check HDD Serial Numbers
# reboot

Installing VirtualBox via pkg

# pkg install emulators/virtualbox-ose-nox11

The following 22 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        virtualbox-ose-nox11: 5.2.30
        libxslt: 1.1.32_1
        libxml2: 2.9.9
        libgcrypt: 1.8.5
        libgpg-error: 1.36
        indexinfo: 0.3.1
        gettext-runtime: 0.20.1
        libvncserver: 0.9.12_2
        png: 1.6.37
        jpeg-turbo: 2.0.2
        lzo2: 2.10_1
        curl: 7.65.1
        libnghttp2: 1.39.2
        ca_root_nss: 3.45
        virtualbox-ose-kmod: 5.2.30
        libIDL: 0.8.14_4
        glib: 2.56.3_5,1
        python36: 3.6.9
        readline: 8.0.0
        libffi: 3.2.1_3
        pcre: 8.43_1
        libiconv: 1.14_11

Number of packages to be installed: 22

The process will require 296 MiB more space.
50 MiB to be downloaded.

Proceed with this action? [y/N]: y
[20/22] Installing virtualbox-ose-kmod-5.2.30...
[20/22] Extracting virtualbox-ose-kmod-5.2.30: 100%
[21/22] Installing libIDL-0.8.14_4...
[21/22] Extracting libIDL-0.8.14_4: 100%
[22/22] Installing virtualbox-ose-nox11-5.2.30...
===> Creating groups.
Creating group 'vboxusers' with gid '920'.
===> Creating users
Creating user 'vboxusers' with uid '920'.
[22/22] Extracting virtualbox-ose-nox11-5.2.30: 100%
Message from python36-3.6.9:
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:
py36-gdbm       databases/py-gdbm@py36
py36-sqlite3    databases/py-sqlite3@py36
py36-tkinter    x11-toolkits/py-tkinter@py36
Message from ca_root_nss-3.45:
********************************* WARNING ********************
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.
Assessment and verification of trust is the complete responsibility of the
system administrator.
*********************************** NOTE **********************
This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual intervention.
If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

  * /etc/ssl/cert.pem
  * /usr/local/etc/ssl/cert.pem
  * /usr/local/openssl/cert.pem                                                                                                             

Message from virtualbox-ose-nox11-5.2.30:
VirtualBox was installed.

You need to load the vboxdrv kernel module via /boot/loader.conf:

You also have to add all users to your vboxusers group in order to use vbox.
% pw groupmod vboxusers -m jerry

Reboot the machine to load the needed kernel modules.

Bridging Support:
For bridged networking please add the following line to your /etc/rc.conf:

USB Support:
For USB support your user needs to be in the operator group and needs read
and write permissions to the USB device.

% pw groupmod operator -m jerry

Add the following to /etc/devfs.rules (create if it doesn't exist):

add path 'usb/*' mode 0660 group operator

To load these new rule add the following to /etc/rc.conf:


Then restart devfs to load the new rules:

% /etc/rc.d/devfs restart

Running VirtualBox as non-root user may fail with a fatal error
NS_ERROR_FACTORY_NOT_REGISTERED. In this case delete /tmp/.vbox-*-ipc file.

If you experience "Network: write Failed: Cannot allocate memory" errors
try to increase net.graph.maxdata in /boot/loader.conf

If you are using AIO, then increase these limits (PR#168298):
To check if AIO is used use: kldstat -v | grep aio

Check wiki page for known issues and troubleshooting:

Please report any problems to emulation@. Thanks!
# kldload vboxdrv
# joe /boot/loader.conf

# sysrc vboxnet_enable=YES
# pw groupmod vboxusers -m root
# pw groupmod vboxusers -m adminvb
# pw groupmod vboxusers -m adminxxx
# service vboxnet start
# chown root:vboxusers /dev/vboxnetctl
# chmod 0660 /dev/vboxnetctl
# ll /dev/vboxnetctrl
crw-rw----  1 root  vboxusers  0x7c Sep  9 18:47 /dev/vboxnetctl
/etc/devfs.conf    # add following lines:

# Allow members of group vboxusers to cat things to the vboxnetctrl
own     vboxnetctl root:vboxusers
perm    vboxnetctl 0660
  • Skip USB and DVD (no hardware)

Installing apache24 & php72

# pkg install phpvirtualbox
>>>>Check for php version:7.2
>>>>Type N 

# pkg install apache24

# sysrc apache24_enable=YES
# /usr/local/etc/rc.d/apache24 start

# pkg install mod_php72

New packages to be INSTALLED:
        mod_php72: 7.2.22
Number of packages to be installed: 1
[activating module `php7' in /usr/local/etc/apache24/httpd.conf]
Message from mod_php72-7.2.22:
Make sure index.php is part of your DirectoryIndex.
You should add the following to your Apache configuration file:
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source

# joe /usr/local/etc/apache24/Includes/php7.conf

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source

# pkg install php72-extensions
New packages to be INSTALLED:
        php72-extensions: 1.0
        php72-session: 7.2.22
        php72-opcache: 7.2.22
        php72-xmlwriter: 7.2.22
        php72-xmlreader: 7.2.22
        php72-dom: 7.2.22
        php72-xml: 7.2.22
        php72-simplexml: 7.2.22
        php72-ctype: 7.2.22
        php72-posix: 7.2.22
        php72-hash: 7.2.22
        php72-filter: 7.2.22
        php72-tokenizer: 7.2.22
        php72-json: 7.2.22
        php72-sqlite3: 7.2.22
        sqlite3: 3.28.0
        php72-pdo_sqlite: 7.2.22
        php72-pdo: 7.2.22
        php72-iconv: 7.2.22
        php72-phar: 7.2.22

# pkg install php72-soap
Message from php72-soap-7.2.22:
This file has been added to automatically load the installed extension:

Installing webmin

Installing phpVirtualBox via pkg

# pkg install phpvirtualbox
This Document is in writing : Draft..........
tips/hypervisor/bsdvb.txt · Last modified: 2019/09/09 19:50 by adminkume