2
votes

So im reinstalling my dev box and wanted to try the virtualbox route.

The guides seem straight forward installing on ubuntu 14.04 headless server with phpvirtualbox but i keep getting stuck this error

When i go to my phpvirtualbox page and try logging in i see this error

Could not connect to host (http://127.0.0.1:18083/)

Exception Object
(
    [message:protected] => Could not connect to host (http://127.0.0.1:18083/)
    [string:Exception:private] => 
    [code:protected] => 64
    [file:protected] => /var/www/html/phpvirtualbox/lib/ajax.php
    [line:protected] => 123
    [trace:Exception:private] => Array
        (
        )

    [previous:Exception:private] => 
)

when i check lsof -i:18083 on the box i see the ports open and listening

vboxwebsr 27978 developer    9u  IPv6  50182      0t0  TCP localhost:18083 (LISTEN)

it also shows its running under the developer user

27982 developer  20   0  481M 11996  9516 S  0.0  0.6  0:00.00 /usr/lib/virtualbox/vboxwebsrv -b

my virtual box config is as followed

VBOXWEB_USER=developer
VBOXWEB_HOST=127.0.0.1
VBOXWEB_PORT=18083

my phpvirtualbox config is as followed

/* Username / Password for system user that runs VirtualBox */
var $username = 'developer';
var $password = '*********';
/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
var $location = 'http://127.0.0.1:18083/';

also php runs soap

soap

Soap Client => enabled
Soap Server => enabled

Directive => Local Value => Master Value
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400

To me all them configs match up as described in the virtualbox install process of making sure you run virtualbox under a specific user and specify that user in the config, the ports open and listening yet the phpvirtualbox interface can't connect, im fully able to manage and access virtualbox from the command line.

If someone could help me understand where im going wrong that would be great.

3

3 Answers

0
votes

Check to see if SELinux is blocking.

I had the same error and it was SELinux keeping phpVirtual box from connecting to the VBox Web service.

0
votes

in config.php
change the location
var $location = 'http://127.0.0.1:18083/';
to
var $location = 'http://localhost:18083/';

I don't know why, maybe something wrong in ubuntu.

0
votes

If you are running selinux, this step my be necessary:

semanage port -a -t http_port_t -p tcp 18083