Building VirtualBox from SVN using Fedora x86_64

Guides for building VirtualBox OSE
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Building VirtualBox from SVN using Fedora x86_64

Post by Perryg »

VirtualBox master build instructions

Warning: SVN is considered bleeding edge. Do not use in a production environment

This is the way I build VirtualBox OSE from SVN and install. Notice that this is the hardened version and must be installed before it will work.
If you want to build using the "./configure --disable-hardening" you will need to add additional symlinks indicated in the VirtualBox master build instructions above.
Note: If this is a rebuild it is suggested that you delete the ~/virtualbox/vbox/out folder before starting to prevent conflicts.

Install Fedora-14 x86_64
  • If you install on metal you will have a fully functional VirtualBox when finished
  • If you install Fedora-14 in a Virtual Machine, it will work up to the actual creation of a Virtual Machine
This is because you can not run a virtualizer inside of a virtualizer (yet), but you can create the actual install in a Virtual Machine.

Note: To make my life easier I add my user name to the sudoers list. That way I don't need to go in and out of sessions. If you don't want to use sudo replace the steps by using su.
Next I disable SeLinux. (If you decide to leave it on the compile time seems longer and VirtualBox has a problem running with it on (in my environment anyway).

Make sure that Fedora is fully updated

Code: Select all

sudo yum update
You should reboot before proceeding.

Next install the necessary packages to install the guest additions (ONLY if you are running Fedora in a Virtual Machine).

Code: Select all

sudo yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel
Install the Guest additions and reboot.

Install necessary packages to be able to build VirtualBox OSE from SVN
Group Packages

Code: Select all

sudo yum groupinstall "Development Tools" "Development Libraries"
Extra Packages not included in the Group Packages

Code: Select all

sudo yum install dev86 iasl qt4-devel pulseaudio-libs-devel glibc-devel.i686 libgcc.i686 texlive-texmf-latex java-1.6.0-openjdk-devel zlib-static glibc-static libstdc++.i686 libxslt-devel libIDL-devel SDL-devel libXmu-devel libstdc++-static wget
Note: F17 and F18 need java-1.7.0-openjdk-devel + Device Mapper

Code: Select all

sudo yum install java-1.7.0-openjdk-devel device-mapper-devel 
The build code is expecting to see /usr/lib/jvm/java-6-openjdk and Fedora puts the package in java-1.*.0-openjdk.x86_64
Create a file called LocalConfig.kmk in the top level build folder and add the absolute path to your java package in the LocalConfig.kmk See example below.

Code: Select all

VBOX_JAVA_HOME := /usr/lib64/jvm/java-1.6.0-sun-1.6.0
We need to add a font that is not included in Fedora

Code: Select all

cd /usr/share/texmf/tex/latex/
mkdir bera
cd bera/
Note: F18 has change the directory structure for texlive to /usr/share/texlive/texmf/tex/latex.
Note: F19 has change even more to the point I had to install the full package of Texlive to get the Docs to build. Use yum install texlive* but be warned this is around 1.5GB in size. You can disable the building of the Docs and not need texlive at all by putting VBOX_WITH_DOCS= in your LocalConfig.kmk

Since Fedora does not provide makeself I use the makeself from Debian. You need makeself and makeself-header. If you get makeself from other sources it may be called and you will either need to rename it or symlink the name to makeself
install makeself in /usr/bin and makeself-header in /usr/share/makeself (you need to create the makeself folder)

[Exit sudo]

Create your build environment. Easiest way is to use your home folder.
mkdir ~/virtualbox

Now you are ready to try to compile VirtualBox from SVN
  • cd ~/virtualbox
    svn co vbox
    cd vbox
    source ./
    kmk all
    cd ~/virtualbox/vbox/out/linux.amd64/release/bin/src
    sudo make install
    cd ~/virtualbox/vbox/src/VBox
    kmk packing
    cp ~/virtualbox/vbox/out/linux.amd64/release/bin/VirtualBox-4.*.*_OSE-r*.run ~/
    cd ~/
    sudo ./VirtualBox-4.*.*_OSE-r*.run install
Add self to vboxusers group
sudo usermod -aG vboxusers <your username>

Run VirtualBox!

Follow up note: I decided to leave the LocalConfig.kmk file alone and install VirtualBox to the /opt folder. It works for me but if you want it installed in a different location you will need to change it in the LocalConfig.kmk file. (instructions are in the VirtualBox master build instructions)

Note: This compiles a complete for distribution build that is installable including the guest additions for your build and can use all of the VirtualBox benefits. If you do not want to install features you need to modify it to your environment as that is not the purpose of this tutorial.