Version 23 (modified by 17 years ago) ( diff ) | ,
---|
Build instructions
This page describes how to build VirtualBox OSE, once you have gotten its source code from our Subversion server, as described on the Downloads page).
The sources are the same, no matter whether you build on Linux or Windows. But the build instructions differ.
To build, use the kmk
command after you have entered our development environment. This is the make
command of kBuild, our homegrown build system. (To avoid confusion with an already installed make program, our make has been renamed to kmk
). With kBuild, the BUILD_TYPE
environment variable determines what type is built and can be release
(enable compiler optimizations, strip debug and profiling code), debug
(for debugging) or profile
(for profiling). The default is release
.
The default build target is all
, which produces all executables in the out/{platform}/{release|debug}/
directories. If you add the packing
target, an installation package is built according to the requirements of your platform (see below).
- [Linux Build Instructions]
- [Windows Build Instructions]
Windows hosts
Prerequisites on Windows
- Visual C++ version 7.1 or 8.0 with ATL installed. It is possible to use the Visual C++ 2005 Express Edition, see below.
- The Windows Platform SDK that comes with Visual C++ or a more recent one from:
web install:
http://www.microsoft.com/downloads/details.aspx?FamilyId=484269E2-3B89-47E3-8EB7-1F2BE6D7123A&displaylang=en - DirectX SDK:
http://www.microsoft.com/downloads/details.aspx?FamilyID=d625324c-59b4-4951-849e-640b508dc442&DisplayLang=en - MingW GCC v3.3.x or v3.4.x with matching binutils, runtime, and w32api:
http://www.mingw.org/download.shtml - SDL v1.2.7 or later development package (VC6):
http://www.libsdl.org/download-1.2.php
To create the installation package:
- .NET, version 2.0 recommended
- Microsoft Windows Installer XML (WiX) toolkit:
http://sourceforge.net/projects/wix/ - Microsoft Driver Installation Framework Tools (DIFx):
http://www.microsoft.com/whdc/driver/install/DIFxtls.mspx
Using Visual C++ 2005 Express Edition
It could be possible to build VirtualBox using the express edition, but the lack of ATL (among other things) means serious trouble since VirtualBox is making use of ATL.
List of problems and possible workarounds:
- It does not include the Platform SDK (PSDK), however the express edition installation guide urge you to install it. If you didn't start here:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ - It does not include the ATL headers and libraries.
A possible workaround could be to point VirtualBox to the ATL headers and libraries that's shipped with the Windows DDK. Unfortunately this doesn't work ATM since the DDK version is older than the one VirtualBox is developed with.
To tell the build system where to find the ATL headers and libraries append the following lines to yourConfig.kmkconf
orConfig.kmklocal
file:PATH_TOOL_VCC80X86_ATLMFC_INC = $(PATH_SDK_W2K3DDKX86)/inc/atl30 PATH_TOOL_VCC80X86_ATLMFC_LIB = $(PATH_SDK_W2K3DDKX86)/lib/atl/i386/ PATH_TOOL_VCC80AMD64_ATLMFC_INC = $(PATH_SDK_W2K3DDKAMD64)/inc/atl30 PATH_TOOL_VCC80AMD64_ATLMFC_LIB = $(PATH_SDK_W2K3DDKAMD64)/lib/atl/amd64/
Another option is to disable the components that depends on the ATL headers / libraries. Unfortunately quite a bit will have to be disabled (the only front end left will be VBoxBFE for instance). Add the following to yourConfig.kmkconf
orConfig.kmklocal
file:VBOX_CFG_MAIN= VBOX_SDLGUI= VBOX_QTGUI= VBOX_WITH_DEBUGGER=
- It does not include mt.exe. This tool can be found in the PSDK, but you need to point the build system to it by appending the following lines to your
Config.kmkconf
orConfig.kmklocal
file:TOOL_VCC80X86_MT = $(PATH_SDK_WIN32SDK)/bin/mt.exe TOOL_VCC80AMD64_MT = $(PATH_SDK_WIN64SDK)/bin/mt.exe
You can get the Visual C++ 2005 Express Edition here: http://msdn.microsoft.com/vstudio/express/visualc/
Building on Windows
- Change to the root directory and execute our configure script to setup your build environment:
wscript configure.vbs
. If The script finds all the tools necessary, it will output two files:Config.kmkconf
containing information where to find the tools on your system andconfigure.bat
, a batch file to setup your environment for building VirtualBox. You only have to execute this step once, unless something about your tools changes in which case you have to repeat the above step. Keep in mind that the script always overwrites the two generated files so you should not manually edit them.
- Change to the root directory of the sources and enter our build shell environment:
configure.bat
.
- To build a release package, type
kmk all packing
. This produces the installation packageout\windows\release\bin\VirtualBox.msi
. If you want to build a debug version, enterkmk BUILD_TYPE=debug all packing
.
- To install this package on your system, double-click on it to feed it into Windows Installer. If this fails for any reason, explicitly running
msiexec /i VirtualBox.msi /l* install.log
produces a log file which may hint at the cause.
Some notes:
During development it may be useful to register the necessary components by hand. Use the following commands with the windows host:
regsvr32 VBoxC.DLL VBoxSVC /RegServer SUPUninstall SUPInstall
For uninstallation:
regsvr32 /u VBoxC.DLL VBoxSVC /UnregServer SUPUninstall
When changing files be sure to have first a look in Windows Taskmanager if the VBoxSVC
server is still running. This may happen if VirtualBox didn't terminate correctly. A quicker alternative is to get pskill
from http://www.sysinternals.com/Utilities/PsKill.html and simply kill VBoxSVC
when uncertain whether it's running or not:
pskill VBoxSVC