VirtualBox

Version 10 (modified by jose, 17 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 XP or Windows Server 2003.
  • Visual C++ version 7.1 or 8.0 (aka. Visual Studio .NET 2003 and 2005).

Using Other Windows Versions

Building VirtualBox on Windows 2000 should work fine except for one or two missing runtime DLLs required by tools or libraries in the VirtualBox build. It is very likely that these DLLs are already installed on your computer by some other program, so you might not even notice.

Building VirtualBox on Windows Vista works fine with one exception, kBuild is making use of the Almquist's ash shell which is built using cygwin. As of writing to get cygwin to work properly on Windows Vista, you will need to use a cygwin1.dll dated 2006-11-02 or later. See http://cygwin.com/ml/cygwin/2006-11/msg00059.html for details and http://cygwin.com/snapshots/ for the dll. Download the dll, unpack it, and copy it to kBuild/bin/x86.win/cygwin1.dll.

(Your are free to try building VirtualBox on NT4 (or earlier) and Windows 95/98/ME, just don't expect it to succeed nor to run.)

Using Visual C++ 2005 Express Edition

If you don't have a Visual C++ edition but still wish to build VirtualBox, it is also possible to use the Visual C++ 2005 Express Edition. However, you will not be able to build everything. In fact the only front end that can be built with this toolset is VBoxBFE becase 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

Qt

The Qt VirtualBox frontend (called VirtualBox.exe) is based on the Qt toolkit version 3.3.x. The GPL version of Qt/Windows is based on Qt 4.x and to our knowledge it (officially) only supports the MinGW compiler. When compiling the Qt frontend using MinGW one has to overcome two road blocks:

  1. The code depends on ATL (again).
  2. The C++ object layout differs so one would have to look into how g++ can call our COM interfaces.

Now, both these roadblocks are solvable - (1) is just a lot of work and (2) is definitely possible (InnoTek has even created binary wrappers between these compilers before) - but we have not yet looked too deeply into it.

All the code is there, feel free to try make it build and work.

Building VirtualBox

  1. 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: Config.kmkconf containing information where to find the tools on your system and configure.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.
  1. Change to the root directory of the sources and enter our build shell environment: configure.bat.
  1. To build a release package, type kmk. This produces the binaries out\x86.windows\release\bin. If you want to build a debug version, enter kmk BUILD_TYPE=debug.

Running VirtualBox

VirtualBox requires devices drivers and COM classes to operate. Whenever these change, you will have to reregister them. In order to reregister 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 reregister the classes, weird problems may appear.

In order to install the VirtualBox kernel driver, issue the following:

SUPUninstall
SUPInstall

Starting VirtualBox is accomplished by invoking one of its frontends, such as

VBoxSDL.exe

Common Build Problems

Cygwin DLL Conflict

If you have cygwin installed on your computer, you might have problems building if your have active cygwin programs or you might have problems starting cygwin programs when the VirtualBox build is running. To fix this, copy the cygwin1.dll from your cygwin installation (usually c:/cygwin/bin/cygwin1.dll) to kBuild/bin/x86.bin/cygwin1.dll.

Note: See TracWiki for help on using the wiki.

© 2023 Oracle
ContactPrivacy policyTerms of Use