Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Building Virtualbox x64 on Windows 10 x64

matthias-prangl edited this page Mar 20, 2019 · 3 revisions

Guest Additions will not be built using these instructions!

Parts of these instructions are based on:

Required packages:

The build was tested with the given versions. Others might work too.

Select x86 or x64 VS2010 toolchain with:

<path_to_vs2010_install>\VC\bin\vcvars32.bat
<path_to_vs2010_install>\VC\bin\amd64\vcvars64.bat

Enable Win10 Test Mode

To use the VBox kernel modules it is necessary to sign the compiled .dll files with a trusted certificate. For testing purposes this can be done by setting up TESTSIGN Mode. Follow the instructions on VBox Build Instructions at section Setting up self signing until Part 3.

Signing .dll files

To sign a .dll file use the SignTool.exe provided by the Windows Driver Development Kit. For example:

C:\WinDDK\7600.16385.1\bin\amd64\SignTool.exe sign <path_to_dll>\mylib.dll

Building OpenSSL (1.1.1b) with /INTEGRITYCHECK

  • Some additional tools are required:
  • Get OpenSSL sources from OpenSSL-1.1.1b
  • Configure both: 32-bit and 64-bit version with the appropriate toolchain and the NASM install directory to PATH:
    • perl Configure VC-WIN64A LDFLAGS="/INTEGRITYCHECK" --prefix=<install_destination>
    • perl Configure VC-WIN32 LDFLAGS="/INTEGRITYCHECK" --prefix=<install_destination>
  • Build with nmake
  • Install to path specified by prefix with nmake install

Building curl (7.64) with /INTEGRITYCHECK

  • Get curl sources from curl-7.64
  • Append /INTEGRITYCHECK to LNKDLL ./winbuild/MakefileBuild.vc:72
  • Build 32-bit and 64-bit versions with the appropriate toolchain:
    • nmake /f Makefile.vc mode=dll VC=10 WITH_SSL=dll SSL_PATH=<path_to_opensslx64> machine=x64
    • nmake /f Makefile.vc mode=dll VC=10 WITH_SSL=dll SSL_PATH=<path_to_opensslx64> machine=x86

Building Qt (5.6.3) with /INTEGRITYCHECK

  • Use x64 toolchain by calling: "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64 /win7
  • Set the appropriate QMAKESPEC: SET QMAKESPEC=<path_to_qt_source>\qtbase\mkspecs\win32-msvc2010
  • Append /INTEGRITYCHECK to file <path_to_qt_source>\qtbase\mkspecs\common\msvc-desktop.conf:77
  • Configure Qt where <install_target> is the folder where Qt will be installed
configure.bat -prefix <install_target> -mp -opensource -confirm-license -nomake tests -nomake examples -no-compile-examples -release -shared -pch -no-ltcg -accessibility -no-sql-sqlite -opengl desktop -no-openvg -no-nis -no-iconv -no-evdev -no-mtdev -no-inotify -no-eventfd -largefile -no-system-proxies -qt-zlib -qt-pcre -no-icu -qt-libpng -qt-libjpeg -qt-freetype -no-fontconfig -qt-harfbuzz -no-angle -incredibuild-xge -no-plugin-manifests -qmake -qreal double -rtti -strip -no-ssl -no-openssl -no-libproxy -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug -no-direct2d -directwrite -no-style-fusion -native-gestures -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtconnectivity -skip qtdeclarative -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns
  • Build with nmake. Sign qtbase\lib\Qt5Core.dll while the the build is still running. Build will fail otherwise
  • Install with nmake install. <install_dir>\plugins\platforms\qwindows.dll has to be signed!

Building VirtualBox

  • Select x64 VS2010 toolchain by calling <path_to_vs2010>\VC\bin\amd64\vcvars64.bat
  • Create the file LocalConfig.kmk at the root of your VirtualBox folder. The file should contain at least these lines (to disable hardening and to disable guest additions):
VBOX_WITH_HARDENING :=
VBOX_WITHOUT_ADDITIONS := 1
VBOX_WITH_ADDITIONS =
  • Configure the build environment:
cscript configure.vbs --with-MinGW-w64=<mingw_path> --disable-sdl --with-openssl=<openssl_x64_path> --with-openssl32=<openssl_x86_path> --with-libcurl=<curl_x64_path> --with-libcurl32=<curl_x86_path> --with-ddk=C:\WinDDK\7600.16385.1 --with-qt5=<qt5_path> --with-python=C:\Python27
  • Source the environment by calling <vbox_build>\env.bat and build with kmk (use kmk KBUILD_TYPE=debug for a debug build)

  • Sign the built .dll files in <vbox_build>\out\win.amd64\debug\bin\

  • Copy the required (and signed) .dll files from Qt, curl and openSSL to <vbox_build>\out\win.amd64\debug\bin\

  • Call <vbox_build>\out\win.amd64\debug\bin\comregister.cmd and then <vbox_build>\out\win.amd64\debug\bin\loadall.cmd from a command prompt with admin privileges (<vbox_build>\env.bat also has to be called!).

  • Run VirtualBox.exe