= Solaris build instructions = The Solaris port of VirtualBox is work in progress and so is this page. The current page is just an edited version of the GNU/Linux one. == Prerequisites == You need: * '''Solaris 11''' is the recommended version for building VirtualBox. * '''GCC 3.4.3+''' is recommended, obtain via Oracle's IPS/pkg(5) repository, see next item. * Install the following packages using: [[br]] {{{ # pkg install SUNWgcc SUNWsvn SUNWhea FSWxorg-headers SUNWgnome-common-devel SUNWaudh SUNWusbu \ SUNWugenu SUNWugen SUNWagph SUNWcurl SUNWxorg-mesa SUNWj6dev SUNWj6dvx header-math }}} * '''IASL''' (Intel ACPI compiler). This is currently included in the VirtualBox source tree. [[br]] The source: http://www.intel.com/technology/iapc/acpi/downloads.htm * '''xsltproc''' (libxslt, XML style sheet processor). This ships with Solaris. [[br]] The source: http://xmlsoft.org/XSLT/downloads.html * '''libIDL'''. This ships with Solaris. [[br]] The source: http://ftp.gnome.org/pub/gnome/sources/libIDL/ * '''libSDL 1.2.x'''. This ships with Solaris. [[br]] The source: http://libsdl.org/download-1.2.php * '''libXcursor''' This ships with Solaris. [[br]] The source: http://ftp.x.org/pub/individual/lib/libXcursor-1.1.9.tar.bz2 * '''Yasm 1.3'''. This ships with Solaris, package name `developer/yasm`. [[br]] The source: http://www.tortall.net/projects/yasm/wiki/Download * '''libxml2'''. This ships with Solaris. * '''libxslt'''. This ships with Solaris. * '''Qt 4.7.4'''. You'll have to build this yourself. [[br]] The source: ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz [[br]] [[br]] Make sure '''QTDIR''' environment variable is pointing to the Qt installation and that the shared libraries can be found. [[br]] Configure example (not the {{{-I}}} options for odd include locations): {{{ ./configure -v -platform solaris-g++-64 -thread -shared -stl -largefile -tablet -sm -disable-sql \ -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -qt-libjpeg -qt-libpng -qt-libmng -qt-zlib \ -prefix /opt/vboxose-qt \ -I/usr/include \ -I/usr/X11/include \ -I/usr/X11/share/include \ -I/usr/sfw/include }}} * Optional: '''Java SE 6 JDK''', only needed if you want to build Java API bindings, both webservice and XPCOM. Grab the binaries from: [[br]] http://www.oracle.com/technetwork/java/javase/downloads/index.html * Optional: Doxygen 1.6.0+. [[br]] http://www.sunfreeware.com/programlistintel10.html#doxygen * The '''PATH''' has to include the following directories: * {{{/usr/sfw/bin}}} - for gcc and related tools. * {{{/usr/ccs/bin}}} - for ar and other tools. * The '''LD_LIBRARY_PATH''' has to include the following directories: * {{{/usr/sfw/lib}}} - for gcc and related tools. * {{{/usr/ccs/lib}}} - for ar and other tools. == Building !VirtualBox == 1. Change to the VirtualBox root directory of the sources and execute the configure script: {{{ `./configure --disable-hardening` }}} If it finds everything it needs, it will create a file called '!AutoConfig.kmk' containing paths to the various tools on your system. Also, it will create an environment setup script called `env.sh`. This step only has to be done once (if something changes in your build tool setup, you might have to repeat it but keep in mind that both output files will be overwritten). 2. Whenever you want to build !VirtualBox, you have to open a shell and source the generated environment setup script 'env.sh', i.e. do {{{ source ./env.sh }}} 3. To build a release package, type {{{ kmk all }}} This produces the required binaries in `out/solaris.x86/release/bin/`. If you want to build a debug version, type: {{{ kmk BUILD_TYPE=debug }}} 4. If you made a hardened build (that is, you omitted the --disable-hardened switch from configure) you have to set some symbolic links manually to be able to start VMs from the bin/ directory: {{{ cd out/solaris.amd64/release/bin/components ln -s ../VBoxDDU.so . ln -s ../VBoxREM.so . ln -s ../VBoxRT.so . ln -s ../VBoxVMM.so . ln -s ../VBoxXPCOM.so . }}} == Running your build == You can run !VirtualBox directly from the build target directory (`out/solaris.x86/release/bin/`). But first of all, you must install the !VirtualBox kernel module. There is a script {{{src/VBox/HostDrivers/Support/solaris/mod.sh}}} which does this for you. It requires you to either install sudo or run it as root. Or, you can do the following: {{{ cd out/solaris.amd64/release/bin }}} You will need to copy the driver file and .conf file (if any), everytime they change, into the appropriate locations. Currently the drivers are `vboxdrv` (the primary host driver), `vboxflt` (bridged & host-only network filter), `vboxnet` (host-only network adapter), `vboxusbmon` (USB monitor), `vboxusb` (USB client). {{{ /platform/i86pc/kernel/drv/ (32-bit drivers and .conf files) /platform/i86pc/kernel/drv/amd64 (64-bit drivers) }}} And then run as root/sudo: {{{ vboxconfig.sh --setupdrivers }}} The vboxconfig script only (re)loads drivers that are found in the appropriate locations (don't forget to copy the ".conf" files). If you made a ''hardened build'', make sure that the setuid stubs have the correct permissions: {{{ for f in VirtualBox VBoxHeadless VBoxSDL VBoxBFE VBoxNetDHCP VBoxNetAdpCtl; do chown root:bin $f chmod 4511 $f done }}} Finally, you can start one of the frontends, e.g. {{{ ./VirtualBox }}}