Menu

Could not connect to host error

Help
sukosevato
2013-09-21
2019-11-05
  • sukosevato

    sukosevato - 2013-09-21

    Hey,

    I've been trying to install Phpvirtualbox for most of the evening now but I can't get it to work. I can access the webinterface but when I try to login with admin/admin I always get the error "Could not connect to host".

    I've edited config.php in the vbox root and I've added "root" and "$password of root" in the config. I've used 127.0.0.1:18083 in the config as well as 192.168.0.140 which is the server ip address. I have installed virtualbox + phpvirtualbox (via ports in freebsd) under root because it's for an internal network and will be behind a VPN. I've also try disabling authentication but that doesn't work either.

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

    When I run : netstat -an | grep 18083" I get no output. So it looks like vboxwebsrv just isn't working. When I run vboxwebsrv -v manually I get the following error: "#### SOAP FAULT: Host not found [SOAP-ENV:Server]". While I run it manually netstat still doesn't return anything.

    root@unix:/usr/local/www/phpvirtualbox # vboxwebsrv -v
    Oracle VM VirtualBox web service Version 4.2.16_OSE
    (C) 2007-2013 Oracle Corporation
    All rights reserved.
    VirtualBox web service 4.2.16_OSE r86992 freebsd.amd64 (Sep 21 2013 02:33:49) release log
    00:00:00.000072 main Log opened 2013-09-21T00:57:11.123053000Z
    00:00:00.000081 main OS Product: FreeBSD
    00:00:00.000085 main OS Release: 9.1-RELEASE-p5
    00:00:00.000089 main OS Version: FreeBSD 9.1-RELEASE-p5 #1: Sun Aug 11 21:04:46 CEST 2013 root@unix:/usr/obj/usr/src/sys/GENERIC_EPIC2
    00:00:00.000093 main Host RAM: 8049MB total, 2639MB available
    00:00:00.000096 main Executable: /usr/local/lib/virtualbox/vboxwebsrv
    00:00:00.000096 main Process ID: 99820
    00:00:00.000097 main Package type: BSD_64BITS_GENERIC (OSE)
    00:00:00.003849 main Pumping COM event queue
    00:00:00.003908 main Pumping COM event queue
    00:00:00.003923 Watchdog Watchdog thread started
    00:00:00.003929 Watchdog Watchdog: sleeping 5 seconds
    00:00:00.031879 SQPmp #### SOAP FAULT: Host not found [SOAP-ENV:Server]
    00:00:05.005663 Watchdog Watchdog: checking 0 sessions
    00:00:05.005678 Watchdog Watchdog: sleeping 5 seconds

    I've reinstall VirtualBox completely with build support. Php works as well in apache (took me a good hour to figure out why I had a blank page).

    system information:
    FreeBSD unix 9.1-RELEASE-p5 FreeBSD 9.1-RELEASE-p5 #1: Sun Aug 11 21:04:46 CEST 2013

    apache22-2.2.25 = up-to-date with port
    php5-5.4.17 = up-to-date with port
    php5-json-5.4.17 = up-to-date with port
    php5-mysql-5.4.17 = up-to-date with port
    php5-session-5.4.17 = up-to-date with port
    php5-simplexml-5.4.17 = up-to-date with port
    php5-soap-5.4.17 = up-to-date with port
    phpvirtualbox-4.2.5 = up-to-date with port
    virtualbox-ose-4.2.16_2 = up-to-date with port
    virtualbox-ose-kmod-4.2.16 = up-to-date with port

    EDIT:
    I have no idea why it doesn't work when it gets started via "/usr/local/etc/rc.d/vboxwebsrv start". If I start it via "vboxwebsrv -H 127.0.0.1" everything does work without errors. Very very strange.

    Is there any way I can edit the rc.d script so it does start with that flag? Or is there another way to solve this so it automatically starts up the way it is supposed?

    I've already tried adding the flag in the rc.d script to no avail. (link to rc.d script: http://pastebin.com/0zvs2McV)

     

    Last edit: sukosevato 2013-09-21
  • Bill Hughes

    Bill Hughes - 2016-03-16

    You may want to try localhost rather than 127.0.0.1

    When we ran lsof -i we found the vboxwebsrv was listed as IPv6. In our config.php we had used the IPv4 address. Changing it to localhost resolved the issue (pun intended).

     
    • Rakuran

      Rakuran - 2016-03-17

      Also having this issue. In my config file is as follows:
      var $location = 'http://localhost:18083/';

      It's still chucking up the Unable to connect to host error. Is this where you suggest I put localhost?

       
  • Robert O

    Robert O - 2016-03-28

    I had this exact error installing after installing it about a dozen times with no issues.

    I caused the issue by moving the home directory of vbox (using sudo)
    The issue was in permissions, and ownership of the home directory.

    I solved it once I noticed the ownership was to root for the home directory.
    chown -aR vbox:vboxusers <home directory="">
    May have to sudo in Ubuntu

    Make sure all files in /var/www/html/phpvirtualbox all have ownership in vboxusers group as well.

     

    Last edit: Robert O 2016-03-28
    • Baub L

      Baub L - 2016-05-03

      I am fairly certain I am having the same problem as you had. I have installed my software at /var/www/vm/html and I noticed ownership wasn't right, so I ran the following: sudo find . -user www-data -exec chown vbmachine:vboxusers {} \;

      That changed the ownership to my user (vbmachine) and group but didn't resolve the problem.
      Would you have any other places I can look for permissions issues?

       
  • B. Turan

    B. Turan - 2016-06-03

    Hi all!
    Although I have tried every suggestion on this thread (or other threads here), I couldn't manage to pass this error:
    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/phpvbox/endpoints/api.php
    [line:protected] => 134
    [trace:Exception:private] => Array
    (
    )

    [previous:Exception:private] =>
    

    )
    It comes after the first login attempt (admin/admin)
    Any idea is appreciated.

     
  • B. Turan

    B. Turan - 2016-06-03

    After disabling authentication from phpvbox' config.php, error message became like this:
    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/phpvbox/endpoints/lib/vboxconnector.php
    [line:protected] => 220
    [trace:Exception:private] => Array
    (
    [0] => Array
    (
    [file] => /var/www/html/phpvbox/endpoints/lib/vboxconnector.php
    [line] => 4110
    [function] => connect
    [class] => vboxconnector
    [type] => ->
    [args] => Array
    (
    )

                )
    
            [1] => Array
                (
                    [file] => /var/www/html/phpvbox/endpoints/lib/vboxconnector.php
                    [line] => 951
                    [function] => remote_vboxGetMedia
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 
                        )
                )
            [2] => Array
                (
                    [file] => /var/www/html/phpvbox/endpoints/api.php
                    [line] => 316
                    [function] => __call
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => vboxGetMedia
                            [1] => Array
                                (
                                    [0] => 
                                    [1] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [data] => Array
                                                        (
                                                            [responseData] => Array
                                                                (
                                                                )
                                                        )
                                                    [errors] => Array
                                                        (
                                                        )
    
                                                    [persist] => Array
                                                        (
                                                        )
    
                                                    [messages] => Array
                                                        (
                                                        )
                                                )
                                        )
                                )
                        )
                )
        )
    [previous:Exception:private] =>
    

    )
    Location:http://127.0.0.1:18083/

     
  • B. Turan

    B. Turan - 2016-06-04

    It is hard to find out a solution via alteration each reasonable line of code, but I have somehow overcomed the recent error by modifying line 16 of current config.php file as:
    var $location = 'http://localhost:18083/';
    Replaced 127.0.0.1 with localhost

     
    • Wojciech Bogacz

      Wojciech Bogacz - 2018-03-07

      In my case it worked perfectly - changing 127.0.0.1 to localhost solved the problem and I was able to login.

       
    • German de Rosas

      German de Rosas - 2019-07-01

      This worked for me! Thanks

       
  • Wesley

    Wesley - 2016-06-09

    Have you found a working solution?

     
  • B. Turan

    B. Turan - 2016-06-12

    I have, as I posted earlier. Here's a follow up:
    My preivous post was on such a system that the host was Ubuntu Server 16.04 with Virtualbox 5.0.20 installed from Ubuntu repository.
    I have tried on a new server installation with similar hardware but with VirtualBox from Oracle's own repository. On that installation, phpVirtualBox has just worked flawlessly without needing to change the "127.0.0.1" address to "localhost". Ubuntu has something wrong on its own VirtualBox compilation and that issue is being posted relative forums.
    Cheers!

     
  • dcweb

    dcweb - 2016-12-29

    Hello, I have exactly the same problem and I have not been able to solve it, I need urgent help

     
  • Jared Janhsen

    Jared Janhsen - 2017-10-03

    I've tried all the suggestions her and I keep getting the same error:

    Exception Object
    (
        [message:protected] => Error logging in to vboxwebsrv.
        [string:Exception:private] => 
        [code:protected] => 64
        [file:protected] => /var/www/html/phpvirtualbox/endpoints/api.php
        [line:protected] => 134
        [trace:Exception:private] => Array
            (
            )
    
        [previous:Exception:private] => 
    )
    

    If I turn on noAuth it makes an even longer error message.

     
  • Chris Rukes

    Chris Rukes - 2018-03-18

    Hello together,
    I am using ubuntu 16.04 LTS and phpvirtualbox 5.0.5
    After some updates I could not connect to the server by IP Adress.
    I tried several things described on some articles. But without success. Do someone have any idea how to solve it. I am not the linux expert to be honest (just starting), so I need some help to get a starting point.

    Exception Object
    (
        [message:protected] => Error logging in to vboxwebsrv.
        [string:Exception:private] => 
        [code:protected] => 64
        [file:protected] => /var/www/html/vb/endpoints/lib/vboxconnector.php
        [line:protected] => 220
        [trace:Exception:private] => Array
            (
                [0] => Array
                    (
                        [file] => /var/www/html/vb/endpoints/lib/vboxconnector.php
                        [line] => 4110
                        [function] => connect
                        [class] => vboxconnector
                        [type] => ->
                        [args] => Array
                            (
                            )
    
                    )
    
                [1] => Array
                    (
                        [file] => /var/www/html/vb/endpoints/lib/vboxconnector.php
                        [line] => 951
                        [function] => remote_vboxGetMedia
                        [class] => vboxconnector
                        [type] => ->
                        [args] => Array
                            (
                                [0] => 
                            )
    
                    )
    
                [2] => Array
                    (
                        [file] => /var/www/html/vb/endpoints/api.php
                        [line] => 316
                        [function] => __call
                        [class] => vboxconnector
                        [type] => ->
                        [args] => Array
                            (
                                [0] => vboxGetMedia
                                [1] => Array
                                    (
                                        [0] => 
                                        [1] => Array
                                            (
                                                [0] => Array
                                                    (
                                                        [data] => Array
                                                            (
                                                                [responseData] => Array
                                                                    (
                                                                    )
    
                                                            )
    
                                                        [errors] => Array
                                                            (
                                                            )
    
                                                        [persist] => Array
                                                            (
                                                            )
    
                                                        [messages] => Array
                                                            (
                                                            )
    
                                                    )
    
                                            )
    
                                    )
    
                            )
    
                    )
    
            )
    
        [previous:Exception:private] => 
    )
    
    Location:http://127.0.0.1:18083/
    
     
  • Phil Melendez

    Phil Melendez - 2019-07-16

    Ran this:

    $ sudo /etc/init.d/vboxweb-service start

    Got this:
    vboxweb-service.sh: Starting VirtualBox web service.
    vboxweb-service.sh: failed: VirtualBox kernel module not loaded!.

    Did this:

    $ sudo /sbin/vboxconfig

    Now working! Yay!

     
    👍
    1
  • Smart Guide

    Smart Guide - 2019-10-09
    Post awaiting moderation.
  • Kir de Vah

    Kir de Vah - 2019-11-05

    I have same problem login on new OS.
    Virtualbox probably isnt running because your kernel module is not compiled for your kernel
    In my case I needed apt -y install linux-headers-$(uname -r)
    Reboot
    That's all.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.