Version 32 (modified by 12 years ago) ( diff ) | ,
---|
Windows build instructions
As VirtualBox is a cross platform project, we use a cross platform build system meaning that there won't be any Visual C++ project files that you can open and just build. Instead, you have to follow these steps but they aren't overly difficult.
Prerequisites
- Windows 7, Windows Vista, Windows Server 2003 or Windows XP SP3.
- Visual Studio 2010 with service pack 1.
- Windows Platform SDK v7.1
http://www.microsoft.com/en-us/download/details.aspx?id=8279
- Windows Driver Development Kit (WDK) v7.1.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11800
- MingW (32-bit Windows only):
GCC 3.3.1: http://prdownloads.sf.net/mingw/gcc-core-3.3.1-20030804-1.tar.gz?download
and http://prdownloads.sf.net/mingw/gcc-g++-3.3.1-20030804-1.tar.gz?download
Runtime: http://prdownloads.sf.net/mingw/mingw-runtime-3.8.tar.gz?download
W32API: http://prdownloads.sf.net/mingw/w32api-3.5.tar.gz?download
Binutils: http://prdownloads.sf.net/mingw/binutils-2.13.90-20021006-2.tar.gz?download
Note that neither GCC v3.4.2 nor v3.4.5 is currently able to build a working recompiler. So, make sure you are using the 3.3.x versions!
- GCC cross compiler targeting 64-bit linux (64-bit Windows only).
Not aware of any binaries available for download, so you have to build your own, unfortunately. (We're slowly working on removing this hurdle.)
- Qt v4.7.x or later
Note! This has to be built with the Visual C++ compiler mentioned above.
- SDL v1.2.7 or later development package (VC6):
http://www.libsdl.org/download-1.2.php
- libxml2 and libxslt1 libraries. Sources and 32bit binaries can be downloaded from:
http://xmlsoft.org/downloads.html
http://xmlsoft.org/XSLT/downloads.html
- the zlib library. Grab the sources from:
http://www.zlib.net/
- the cURL library. Grab the binaries from:
http://curl.haxx.se/download.html
(use the devel version without SSL support)
- OpenSSL 0.9.8k. Grab the binaries from:
http://www.openssl.org/related/binaries.html
Building VirtualBox
- Change to the root directory and execute our configure script to setup your build environment:
cscript configure.vbs
If The script finds all the tools necessary, it will output two files:AutoConfig.kmk
containing information where to find the tools on your system andenv.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:
env.bat
.
- To build a release package, type
kmk
. This produces the binaries inout\win.x86\release\bin
. If you want to build a debug version, enterkmk KBUILD_TYPE=debug
.
Using Visual C++ 2010 Express
If you don't have a Visual C++ license but still wish to build VirtualBox, it is also possible to use the Visual C++ 2010 Express. However, you will not be able to build everything. In fact the only front end that can be built with this toolset is VBoxBFE because the VirtualBox COM API - which all the other front ends program against - requires the Active Template Library (ATL) to build, and unfortunately the express edition doesn't include this (see http://msdn.microsoft.com/vstudio/express/support/faq/#vcpp).
When doing the first build step, you have to add --with-VC-Express-Edition to the argument list:
cscript configure.vbs --with-VC-Express-Edition
Running VirtualBox
VirtualBox requires devices drivers and COM classes to operate. Whenever these change, you will have to re-register them. In order to re-register the COM classes, execute
comregister.cmd
which can be found in the output directory. Note that for this to work, VBoxSVC.exe
must not be running, so use the Windows task manager to verify this. Usually VBoxSVC.exe
terminates automatically after 5 seconds of inactivity (i.e. no client connection) but especially when developing, it might sometimes stay around. In case the COM classes change (this usually happens when the file VirtualBox.xidl
is updated) and you forget to re-register the classes, weird problems may appear.
In order to (re-)install the VirtualBox kernel drivers, issue the following:
loadall.cmd
Starting VirtualBox is accomplished by invoking one of its frontends, such as
VBoxSDL.exe
or
VirtualBox.exe