Build VirtualBox 5.1 on Linux

Discussions related to using the OSE version of VirtualBox.

Build VirtualBox 5.1 on Linux

Postby lmolas » 23. Mar 2017, 06:15

Hi, I'm trying to build VirtualBox 5.1.18 from source in Ubuntu 16.04 with the
hardening disabled, following the "Linux build instructions" from the Technical
docs:

https://www.virtualbox.org/wiki/Linux%2 ... structions

The build succeeds but a path related error follows when I try to run the
VirtualBox executable (detailed information later on). My question is (from the
following build commands) if I'm missing some install command or some
environment variable configuration after the build, due to the fact that I'm
trying to run the program from the build target directory.

Code: Select all   Expand viewCollapse view
./configure --build-debug --disable-hardening
source ./env.sh
kmk

# Build and install the VirtualBox kernel module
cd out/linux.amd64/$BUILD_TYPE/bin/src
make
sudo make install


(I've omitted the commands related to the setup and installation of the
prerequisite packages for Ubuntu as the build is succeeding and I don't think
they're relevant to the problem.)

When running the build I get the following error:

Code: Select all   Expand viewCollapse view
$ out/linux.amd64/debug/bin/VirtualBox

!!Assertion Failed!!
Expression: g_szrtProcExePath[0]
Location  : /home/user/vbox-src/src/VBox/Runtime/r3/path.cpp(66) int RTPathExecDir(char*, size_t)
Trace/breakpoint trap (core dumped)


As I've seen in the code, g_szrtProcExePath is "the process path" (if I
understand correctly) used later on to locate other executables, and this
particular assert is complaining because this global variable hasn't been
initialized (and it has been left empty).

If I do a release build (without the --build-debug) to avoid the assert (not
as solution but to investigate the problem further) I get an error which
could also (but I'm not sure) be related to a path not being resolved
correctly:

Code: Select all   Expand viewCollapse view
Failed to initialize COM or to find the VirtualBox COM server. Most likely, the VirtualBox server is not running or failed to start.
The application will now terminate.
Callee RC: NS_ERROR_FAILURE (0x80004005)


There is a section in the build instructions, "Building VirtualBox packages for
distribution", which mentions the configuration of:

default pathes which are used by the VirtualBox binaries to find their components.


Although I understand they don't apply to this type of build (with the
hardening disabled) I followed its instructions to see if that helped with
this issue but it didn't change the outcome. (I actually copied the
LocalConfig.kmk from the debian/ directory which had the same definitions.)
lmolas
 
Posts: 3
Joined: 17. Mar 2017, 21:30

Re: Build VirtualBox 5.1 on Linux

Postby frank » 21. Apr 2017, 11:07

If you are building VirtualBox as 'debug' build then you have to be prepared to catch assertions. Such assertions are not always triggered by real problems: They might also point to a potential problem. To run a 'debug' build I suggest to run VBoxSVC and the frontend (VirtualBox or VBoxHeadless) in separate consoles, both from gdb. An assertion will trigger an int3 and with gdb you can continue.

Please don't bother with questions about specific assertions: There is no time to explain them all. If you are sure that you found a problem then feel free to report it (either here or using the bugtracker).
frank
Oracle Corporation
 
Posts: 3363
Joined: 7. Jun 2007, 09:11
Location: Dresden, Germany
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows


Return to VirtualBox OSE

Who is online

Users browsing this forum: No registered users and 2 guests