Version 30 (modified by 17 years ago) ( diff ) | ,
---|
Linux build instructions
While we try to not favor any distribution, we only build with certain distributions. This includes Debian, Ubuntu, Gentoo and Red Hat Enterprise Linux. Things should not be much different for other distributions though. If you want to supply specific build instructions (especially package names) for other distributions, please contact InnoTek.
Prerequisites
You need:
- GCC 3.2.3 or later (except for the GCC 4.0.x series)
- as86 (real mode assembler, usually part of the dev86 or bin86 package.)
- bcc (Bruce Evans C Compiler; often part of the dev86 package)
Note: The bcc compiler contained in openSUSE10.2 as part of dev86-0.16.0-218 is known to generated broken code. Unfortunately, bcc -v is not supported.
- IASL (Intel ACPI compiler)
- xsltproc (libxslt, XML style sheet processor)
- libxerces (Xerces XML parser; the C++, not the Java version)
- libxalan (Xalan XSL library, depends on Xerces; again, the C++, not the Java version)
- libXcursor (required to support color mouse pointers in guest)
- Qt 3.3.x (with x >= 5 if possible)
- libIDL
- libSDL
- ALSA
- PulseAudio
- libhal
On 64-bit systems you need the following packages as well:
- ia32-libs (various libraries needed for compiling the 32-bit guest additions)
- libc6-dev-i386 (libc6 i386 development headers)
- lib32gcc1 (gcc support for i386)
- gcc-multilib (gcc support for i386)
- lib32stdc++6 (libstdc++ for i386)
- g++-multilib (g++ support for i386)
On Debian-based systems, the following command should install the required packages:
apt-get install gcc g++ bcc iasl xsltproc xalan libxalan110-dev uuid-dev \ zlib1g-dev libidl-dev libsdl1.2-dev libxcursor-dev \ libqt3-headers libqt3-mt-dev libasound2-dev libstdc++5 \ libhal-dev libpulse-dev
On 64-bit Debian-based systems, the following command should install the required additional packages:
apt-get install ia32-libs libc6-dev-i386 lib32gcc1 gcc-multilib \ lib32stdc++6 g++-multilib
On Gentoo, the following should do:
emerge -av sys-devel/bin86 sys-devel/dev86 sys-power/iasl libxslt xerces-c \ xalan-c libXcursor =qt-3* libIDL libsdl libhal-dev
Note that VirtualBox makes use of YASM as its assembler which is part of the source repository as the currently available releases of YASM contain various bugs. As soon as a working release becomes officially available, we will add YASM to the list of prerequisites.
Building on a 64bit host still requires 32bit libraries and build tools as the Guest Additions which are part of the build process are 32bit.
Building VirtualBox
- Change to the root directory of the sources and execute the configure script:
./configure
. 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 calledenv.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).
- 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
- To build a release package, type
kmk all
. This produces the required binaries inout/linux.x86/release/bin/
. (If you want to build a debug version, typekmk BUILD_TYPE=debug
.) In case you have more than one CPU core, you could take advantage of our parallel build system by supplying-j3
(number of cores + 1) as an option to kmk.
Running your build
You can run VirtualBox directly from the build target directory (out/linux.x86/release/bin/
). But first of all, you must build and install the VirtualBox kernel module, whose sources will have been copied to the build target directory.
So, issue the following:
cd out/linux.x86/release/bin/src make sudo make install cd ..
Then it should have been installed to your modules directory and you can load it using modprobe vboxdrv
. Make sure you give yourself read and write access to /dev/vboxdrv
.
Finally, you can start one of the frontends, e.g.
LD_LIBRARY_PATH=. ./VirtualBox
Note that the LD_LIBRARY_PATH=.
is required because we have to find our .so
files and the output directory is not in the system's library path.