Changeset 4064 (also 4127)
introduced passing the DISPLAY variable of the starting application to the VM process but neglected to also pass XAUTHORITY, which is needed to open the X window.
If VBoxSVC is already running without XAUTHORITY set, opening a VM via the VirtualBox GUI or VBoxManage fails ("/usr/bin/VirtualBox --startvm " does work).
Only DISPLAY is passed from the Frontends.
E.g. from /src/VBox/Frontends/VBoxManage/VBoxManage.cpp:
const char *display = RTEnvGet ("DISPLAY");
if (display)
env = Utf8StrFmt ("DISPLAY=%s", display);
Sample error messsage:
$ VBoxManage startvm IMARS
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Waiting for the remote session to open...
ERROR: Virtual machine 'IMARS' has terminated unexpectedly during startup
Details: code NS_ERROR_FAILURE (0x80004005), component Machine, interface IMachine, callee <NULL>
Of course if I disable X security if works fine:
$ xhost +
access control disabled, clients can connect from any host
$ VBoxManage startvm IMARS
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Waiting for the remote session to open...
Remote session has been successfully opened.