How to Build VirtualBox on Linux
Building VirtualBox on Linux
When I first tried to build
VirtualBox,
the configure
script returned a number of
errors:
missing as86, missing IDL, missing SDL, and so on.
I had to add these packages on a
Mageia
system (and see
this page
for how to add and manage packages):
dev86 iasl libIDL-config lib64IDL2-devel libcurl-devel lib64SDL lib64SDL-devel lib64python2.6-devel makeself
That allowed the configure
script to run,
but now the next step failed:
% make kmk [ ... much output deleted ... ] /usr/bin/ld: cannot find -lstdc++
Depending on the sequence of events, the missing libraries
may be listed as
-lcrypt,
-lpthread,
etc.,
even though /lib64
and /usr/lib64
contain libcrypto.so*.
But the libstdc++-devel
package is
installed...
I eventually realized that I needed the
libstdc++-static-devel
package.
After installing that and re-running the configure
script I got a different error.
Actually a bunch of errors along these
general lines:
/home/cromwell/VirtualBox-4.1.8_OSE/src/libs/xpcom18a4/java/src/nsJavaXPCOMBindingUtils.cpp:57: error: 'jclass' does not name a type
My solution was to solve the problem by avoiding it:
% ./configure --disable-java % kmk all
That cleanly built the VirtualBox binaries. Then I was able to build and install the Linux kernel module:
% out/linux.amd64/release/bin/src
% make
% su
Password: ################
# make install
# for f in VirtualBox VBoxHeadless VBoxSDL VBoxBFE VBoxNetDHCP VBoxNetAdpCtl; do
> chown root.root $f
> chmod 4511 $f
> done
Now I can run virtual machines with VirtualBox!
% ~/VirtualBox-4.1.8_OSE/bin/VirtualBox &