Building from Source Code

This page will show you how to compile and install OpenNebula from the sources.

Compiling the Software

Follow these simple steps to install the OpenNebula software:

  • Download and untar the OpenNebula tarball
  • Change to the created folder and run scons to compile OpenNebula
$ scons [OPTION=VALUE]

The argument expression [OPTION=VALUE] is used to set non-default values for :

OPTIONDefaultVALUE
sqlite_dirpath-to-sqlite-install
sqliteyesno if you don’t want to build Sqlite support
mysqlnoyes if you want to build MySQL support
xmlrpcpath-to-xmlrpc-install
parsersnoyes if you want to rebuild Flex/Bison files.
new_xmlrpcnoyes if you have an xmlrpc-c version >= 1.31
sunstonenoyes if you want to build Ruby Sunstone minified files
fireedgenoyes if you want to build FireEdge minified files
systemdnoyes if you want to build systemd support
rubygemsnoyes if you want to generate Ruby gems
svnctermyesno to skip building VNC support for LXD drivers
contextnoyes to download guest contextualization packages
downloadnoyes to download 3rd-party tools (Restic, Prometheus…)

If the following error appears then you need to remove the option ‘new_xmlrpc=yes’ or install xmlrpc-c version >= 1.31:

error: 'class xmlrpc_c::serverAbyss::constrOpt' has no member named 'maxConn'
  • OpenNebula can be installed in two modes: system-wide or in self-contained directory. In either case, you do not need to run OpenNebula as root. These options can be specified when running the install script:
./install.sh <install_options>
$ sudo ./install.sh <install_options>

where <install_options> can be one or more of:

OPTIONVALUE
-uuser that will run OpenNebula, defaults to user executing install.sh
-ggroup of the user that will run OpenNebula, defaults to user executing install.sh
-kkeep configuration files of existing OpenNebula installation, useful when upgrading. This flag should not be set when installing OpenNebula for the first time
-dtarget installation directory. If defined, it will specified the path for the self-contained install. If not defined, the installation will be performed system wide
-conly install client utilities: OpenNebula cli and ec2 client files
-sinstall OpenNebula Ruby Sunstone
-pdo not install OpenNebula Ruby Sunstone non-minified files
-Finstall OpenNebula FireEdge
-Pdo not install OpenNebula FireEdge non-minified files
-Ginstall OpenNebula Gate
-6install only OpenNebula Gate Proxy
-finstall OpenNebula Flow
-rremove Opennebula, only useful if -d was not specified, otherwise rm -rf $ONE_LOCATION would do the job
-lcreates symlinks instead of copying files, useful for development
-hprints installer help

The packages do a system-wide installation. To create a similar environment, create a oneadmin user and group, and execute:

oneadmin@frontend:~/ $> wget <opennebula tar gz>
oneadmin@frontend:~/ $> tar xzf <opennebula tar gz>
oneadmin@frontend:~/ $> cd opennebula-x.y.z
oneadmin@frontend:~/opennebula-x.y.z/ $> scons -j2 mysql=yes syslog=yes fireedge=yes
[ lots of compiling information ]
scons: done building targets.
oneadmin@frontend:~/opennebula-x.y.z $> sudo ./install.sh -u oneadmin -g oneadmin

Ruby Dependencies

All required Ruby gems are provided by the opennebula-rubygems package. Please check the Installation guide for more information on installing this package.

Building Python Bindings from Source

In order to build the OpenNebula python components it is required to install pip package manager and the following pip packages:

Build Dependencies:

  • generateds: to generate the python OCA
  • setuptools: to generate python package
  • wheel: to generate the python package

Run Dependencies:

  • dict2xml: python OCA support
  • lxml: python OCA support
  • xml2dict: python OCA support
  • requests: python OCA support

To build run following:

root@frontend:~/ $> cd src/oca/python
root@frontend:~/ $> make
root@frontend:~/ $> make dist
root@frontend:~/ $> make install

Building Sunstone from Source

root@frontend:~/ $> cd ~/one/src/fireedge
root@frontend:~/ $> npm install
root@frontend:~/ $> cd ~/one
root@frontend:~/ $> scons fireedge=yes
root@frontend:~/ $> ./install.sh -F -u oneadmin -g oneadmin