Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot login to vboxwebsrv #89

Open
3PO opened this issue Jan 25, 2018 · 10 comments

Comments

@3PO
Copy link

commented Jan 25, 2018

Hi,

I'm using VirtualBox 5.2.6 on Gentoo Linux and i installed phpvirtualbox for git, but i connot login.

This is the issue form the Browser:

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

    [previous:Exception:private] => 
)

In the Logfile i only can see this issue:

Jan 25 22:27:57 [vboxwebsrv] pam_securetty(login:auth): cannot determine user's tty

Any suggestions where are my fault?

@tom077

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2018

Hi,

First, check that you have followed all the instructions from the Wiki.

Then, the most probable reason is that you have provided a wrong username/password in your config.php :

var $username = 'the name of the user running vboxwebsrv';
var $password = 'its password';
@3PO

This comment has been minimized.

Copy link
Author

commented Jan 25, 2018

vboxwebsrv is running as root:

server01 ~ # ps aux |grep vboxwebsrv
root      4985  0.0  0.0  13144   916 pts/0    S+   23:05   0:00 grep --colour=auto vboxwebsrv
root     17778  0.0  0.1 572620 19464 ?        Ssl  20:54   0:00 /usr/lib64/virtualbox/vboxwebsrv -H localhost -p 18083 -t 20 -i 5
server01 ~ #

And the config.php is correct:

/* Username / Password for system user that runs VirtualBox */
var $username = 'root';
var $password = 'MYROOTPASSWORD';
@tom077

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2018

OK thanks.

Just to be sure that your problem is not related to the way Virtuabox is build with Gentoo (or to the dependencies used to build it), you can try to download the Virtualbox SDK.

Unzip the VirtualBoxSDK-5.2.6-120293.zip file.
Copy these file to the same folder :
sdk/bindings/webservice/vboxweb.wsdl
sdk/bindings/webservice/vboxwebService.wsdl
sdk/bindings/webservice/php/lib/vboxServiceWrappers.php
sdk/bindings/webservice/php/samples/clienttest.php

edit the file "clienttest.php"

$virtualbox = $websessionManager->logon("root","YOUR ROOT PASSWORD");

run php -f clienttest.php

If you get a "Uncaught SoapFault exception" or any other error, your problem is not related to phpvirtualbox.

@3PO

This comment has been minimized.

Copy link
Author

commented Jan 25, 2018

I get this issue:

server01 tmp # php -f clienttest.php
PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client]  in /tmp/vboxServiceWrappers.php:12469
Stack trace:
#0 /tmp/vboxServiceWrappers.php(12469): SoapClient->__soapCall('IWebsessionMana...', Array)
#1 /tmp/clienttest.php(47): IWebsessionManager->logon('root', '#######')
#2 {main}
  thrown in /tmp/vboxServiceWrappers.php on line 12469
server01 tmp #

And now??

@tom077

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2018

I would recommend you to submit your clienttest.php issue to the Virtualbox bug tracker.

But the strange thing is that I can reproduce the same clienttest.php stack trace if I deliberately use a wrong password in $virtualbox = $websessionManager->logon("","");

PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client]  in /srv/http-ssl/vboxServiceWrappers.php:12469
Stack trace:
#0 /srv/http-ssl/vboxServiceWrappers.php(12469): SoapClient->__soapCall('IWebsessionMana...', Array)
#1 /srv/http-ssl/clienttest.php(47): IWebsessionManager->logon('vbox', '#########')
#2 {main}
  thrown in /srv/http-ssl/vboxServiceWrappers.php on line 12469

Maybe you could try another Linux account (not root) to run vboxwebsrv and log in.
I use a dedicated user "vbox".

@tom077

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2018

I just tried to run vboxwebsrv as root instead of my dedicated user "vbox".

I get the same stack trace :

PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client]  in /srv/http-ssl/vboxServiceWrappers.php:12469
Stack trace:
#0 /srv/http-ssl/vboxServiceWrappers.php(12469): SoapClient->__soapCall('IWebsessionMana...', Array)
#1 /srv/http-ssl/clienttest.php(47): IWebsessionManager->logon('root', 'good password')
#2 {main}
  thrown in /srv/http-ssl/vboxServiceWrappers.php on line 12469

It seems that vboxwebsrv doesn't accept connection if run as root.

@tom077

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2018

It is even more obvious if you look at your vboxwebsrv log file :

00:05:39.159198 SQW05    Processing connection from IP=127.0.0.1 socket=13 (1 out of 5 threads idle)
00:05:39.159305 SQW05    -- entering __vbox__IWebsessionManager_USCORElogon
00:05:40.068779 SQW03    authenticate(): result of AuthEntry('root', [9]): 0 (access DENIED)
00:05:40.068836 SQW03    Access for user 'root' denied
@3PO

This comment has been minimized.

Copy link
Author

commented Jan 26, 2018

It seems that vboxwebsrv doesn't accept connection if run as root.

Yes, that's the trick! :)

I added a user "vbox" and added this user to group "vboxusers".

useradd vbox
passwd vbox
gpasswd -a vbox vboxusers

I've edited the config file:

# User under which vboxwebsrv is running
VBOXWEBSRV_USER="vbox"

Then i restarted the service "vboxwebsrv".

Now the vboxwebsrv service is running as user vbox:

server01 ~ # ps aux |grep vbox
vbox     26415  0.2  0.1 895512 23288 ?        Ssl  20:14   0:00 /usr/lib64/virtualbox/vboxwebsrv -H localhost -p 18083 -t 20 -i 5
vbox     26435  0.0  0.0 121412 11008 ?        S    20:14   0:00 /usr/lib64/virtualbox/VBoxXPCOMIPCD
vbox     26440  0.1  0.1 544028 19172 ?        Sl   20:14   0:00 /usr/lib64/virtualbox/VBoxSVC --auto-shutdown
root     30394  0.0  0.0  13144   884 pts/5    S+   20:16   0:00 grep --colour=auto vbox
server01 ~ #

i changed the config.php to:

/* Username / Password for system user that runs VirtualBox */
var $username = 'vbox';
var $password = 'vbox';

And now it works fine! 👍

2018-01-26_202907

BTW:
For using https, i followed this Wiki, and login via https works as well. 👍

Maybe you can implant some code, that checks, if "vboxwebsrv" is running as root?
Additional this should added to the README and Wiki. ;)

PS:
clienttest.php gives a issue anyway:

server01 tmp # php -f clienttest.php
PHP Notice:  Undefined property: stdClass::$returnval in /tmp/vboxServiceWrappers.php on line 1147

server01 tmp # 

But it works, so who cares. :)

@tom077

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2018

Glad to read that.

Thank you for having highlighted that new issue. Really helpful.

@a1computers

This comment has been minimized.

Copy link

commented Jan 31, 2019

Of all the forums, this solved the issue. THANKS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.