Install ERPNext using VirtualBox on FreeBSD 11.2

This post is the first in a series on Using ERPNext. Search for “ERPNext” to find other posts in the series and please visit the demo on

The simplest “install” for ERPNext on FreeBSD has to be using the ERPNext Virtual Image with VirtualBox, which is well-supported on FreeBSD.

I once attempted to install ERPNext on bare metal FreeBSD using the ERPNext Easy Install script, but found too many dependencies on Linux to resolve and eventually switched to CentOS where the Easy Install script worked as promised. This time I used the pre-built VirtualBox virvm provided by the project. I considered using bhyve (the BSD hypervisor) for hosting but found bhyve does not support VirtualBox’s OVF disk image (I later learned it is possible to convert the OVF to the raw format required by bhyve using qeum-image).

The server is a re-purposed media PC with an Intel E6600 Core 2 CPU and 6 GB RAM (DDR2 PC2-5300) running 64-bit FreeBSD 11.2.  ERPNext performance has been completely satisfactory in a demo situation with several users. 

Install VirtualBox

I started by installing the virtualbox-ose-nox11 package which enables running headless virtual machines. The VirtualBox kernel module (virtualbox-ose-kmod) will also be installed.

% sudo pkg install virtualbox-ose-nox11

Unfortunately, currently on FreeBSD 11.2 the VirtualBox kernel module must be compiled from source or the system will crash during boot (if the kernel module is loaded at boot). 

Compiling the virtualbox-ose-kmod is straightforward. First you must have the FreeBSD sources installed.

% fetch % tar -C / -xzvf src.txz

Next I installed the ports collection to compile the virtualbox-ose-kmod port from source. 

# portsnap fetch
# portsnap extract

Finally I compiled and installed the virtualbox-ose-kmod port. Make first refused to install the module because it was already installed. I followed the instructions in the error output and deinstalled the old port then installed the newly compiled one.

% cd /usr/ports/emulators/virtualbox-ose-kmod
% sudo make install
% sudo make deinstall
% sudo make reinstall

Following the post-install instructions,

1) edit /boot/loader.conf to load the vboxdrv kernel module at boot,

# vi /boot/loader.conf

2) increase AIO limits by editing /etc/sysctl.conf (my server is using AIO, for more information refer to the virtualbox-ose-nox11 pkg-message).


You can then reboot the system to load the kernel module (or it can be loaded manually).

The user that VirtualBox runs as must be a member of the vboxusers group. For simplicity, I’ll run VirtualBox using my own username, although best practise would be to create a dedicated user.

# pw groupmod vboxusers -m dale

Edit /etc/rc.conf to run vboxwebsrv (the Virtual Box web interface daemon) using the provided startup script installed in /usr/local/etc/rc.d/

% sudo vi /etc/rc.conf


and finally start the vboxwebsrv service.

% sudo service vboxwebsrv start
% sudo service vboxwebsrv status

This does not start a virtual machine. I will use phpVirtualBox to manage virtual machines interactively. A vboxheadless rc.d script is provided if you wish to automate starting a vm at system boot. 

Install phpVirtualBox

phpVirtualBox is a web-based management application for VirtualBox.

# pkg install phpvirtualbox

Edit the phpVirtualBox config.php file appropriately.

# vi /usr/local/www/phpvirtualbox/config.php

var $username = 'dale';
var $password = 'dale_login_password';

Finally configure the webserver to serve phpVirtualBox. I use Apache 2.4 and added a virtual host definition to /usr/local/etc/apache24/extra/httpd-vhosts.conf to serve phpvirtualbox as a

  DocumentRoot "/usr/local/www/phpvirtualbox"
  <Directory "/usr/local/www/phpvirtualbox">
    allow from all
    Options None
    Require all granted

“Install” ERPNext

Download an ERPNext Virtual Machine image (*.ova file) to /usr/home/dale/downloads (or some other suitably arbitrary location).

% cd ~/downloads
% wget

Using phpVirtualBox, create a new vm by importing the downloaded ERPNext-Production.ova Virtual Image file (File/Import). It includes port forwarding rules to forward client port 80 (used by the vm to serve ERPNext) to host port 8080. There is also a rule to forward ssh from client port 22 to host port 3022.

Start the vm and then login to ERPNext from a browser (e.g. using the default credentials. The new site wizard will run and lead you through ERPNext configuration. Use a secure password when defining the initial (admin) user, and the wizard will delete the initial Administrator user (with default password) when complete. 

Once logged into ERPNext, you will likely want to setup email processing so that users will receive notifications outside of ERPNext. This will be valuable to understanding and appreciating ERPNext’s significant social aspect. You will also want to change the password for the configured system user to something secure (or even disable password authentication entirely in favour of key-based authentication).



4 Replies to “Install ERPNext using VirtualBox on FreeBSD 11.2”

  1. Dear Dale
    I have successfully migrate from ERPNext 3 to 4.
    The error you posted is not relevant for python 2.7 and can be ignored but python needs to be recompiled on freebsd with the option SEM enabled. It is by default disabled. Following the migration guide after this works perfectly fine

    1. Thank you Samuel for your comment.

      For the benefit of others, Samuel’s comment relates to the first version of this post, which described an an unsuccessful attempt to install ERPNext directly on FreeBSD, following the Linux Easy Install script. Samuel reports re-compiling Python would have solved my roadblock.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.