How to Install Oracle VirtualBox in FreeBSD

This tutorial walks you through how to install Oracle VirtualBox in FreeBSD. For the purpose of this tutorial, I will be using FreeBSD 10.3 with MATE desktop environment. If you don’t know how to install MATE desktop in FreeBSD, refer the following link.

Well, let us get started.

Update FreeBSD system and Ports tree

First of all, update your FreeBSD system using command as root user:

freebsd-update fetch install

Then, update the ports tree using command:

portsnap fetch update
portsnap extract

This will take a few moments. Please be patient.

Install Oracle VirtualBox in FreeBSD

After updating the ports tree, Cd to virtualbox-ose directory.

cd /usr/ports/emulators/virtualbox-ose

Run the following command to build and install VirtualBox.

make install clean

Don’t forget to select the GUESTADDITION option along with default selection. We need Guest additions for the FreeBSD guests to provide the following support.

  • Clipboard sharing
  • Mouse pointer integration
  • Host Time synchronization
  • Window scaling
  • Seamless mode

Select GUESTADDITION option and click OK to continue.


During installation, you’ll be asked to answer a couple of questions. Just Click OK to accept the default values and continue. Please note that this process will take a quite long time (Around 1-3 hours depending upon the machine configuration).

And, You will have to answer a lot of questions like below. So, don’t leave your system. Just click OK whenever it ask you to continue.

Click OK to continue.




Like I said, this will take quite long time, may be 2-3 hours to complete.

Post installation

After installing VirtualBox, we need to do couple of tasks.

First, add the local system’s users to vboxusers group.

To do so, run:

pw groupmod vboxusers -m ostechnix

Here, ostechnix is my FreeBSD system’s username.

Next load the virtualbox Kernel modules at boot time as shown below.

Edit /boot/loader.conf file.

nano /boot/loader.conf

Add the following line in it.


For bridged or host-only networking support, edit /etc/rc.conf file,

nano /etc/rc.conf

Add the following line:


Also, add the users to the operator group as shown below.

pw groupmod operator -m ostechnix

Replace ostechnix with your own username.

Then enable USB read/write permissions to the users in the operator group.

To do so, edit /etc/devfs.rules file,

nano /etc/devfs.rules

If the above file doesn’t exist, create it.

Add the following line in it.

add path 'usb/*' mode 0660 group operator

To load these rules, edit /etc/rc.conf file,

nano /etc/rc.conf

Add the following line:


Restart defs service to apply these changes.

/etc/rc.d/devfs restart

Next, enable Host CD/DVD access to all guest machines. It is very important.

Enable atapicam kernel module at boot.

To do so, edit /boot/loader.conf file:

nano /boot/loader.conf

Add the following line:


Enable HAL Kernel module too.

To do so, edit /etc/rc.conf file:

nano /etc/rc.conf

Add the following line:


Start the hald service.

/usr/local/etc/rc.d/hald start

Your user account needs permissions to access /dev/xpt0, /dev/cdN and /dev/passN . TO do so, Edit /etc/devfs.conf file:

nano /etc/devfs.conf

Add the following lines:

perm cd0 0660
perm xpt0 0660
perm pass0 0660

Finally, restart your FreenBSD system to apply all changes.

Now, Oracle VirtualBox is ready to run guest machines.

You might want to download the following free EBooks related to Oracle VirtualBox.

That’s all for now. If you like this tutorial, please share it on your social networks and support OSTechNix.


Source and Reference links:

Thanks for stopping by!

How can I benefit from this blog:

Have a Good day!!

You may also like...