When trying to login in to phpvirtualbox, I get the message below:

Could not connect to host (

When I click on "details", I see:

Exception Object
[message:protected] => Could not connect to host (
[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] => 

My server is Ubuntu 16.04 LTS Xenial. How can I fix this?

migrated from meta.askubuntu.com Jun 15 '16 at 14:20

This question came from our discussion, support, and feature requests site for Ubuntu users and developers.


Add the user that runs the virtualmachines, your login account for example, to the vboxusers group:

sudo usermod -aG vboxusers USERACCOUNT

Then make sure to give the right ownership to the www dir:

sudo chown -R www-data:vboxusers /var/www/html/phpvirtualbox

Please note that if you have different locations you'd have to change it.

If that doesnt work please post the outcome of the following command:

ls -la /var/www/html
  • Instead of sudo usermod -aG vboxusers USERACCOUNT, the simpler alternative would be sudo adduser USERACCOUNT vboxusers. – Byte Commander Jun 16 '16 at 19:25
  • Thank you for your help. But in this case decided by changing two files and reinciciando the vboxweb service and daemon: /etc/systemd/system/multi-user.target.wants/vboxweb-service.service /lib/systemd/system/vboxweb-service.service I pulled the files of another 16:04 server that already ran the phpvirtualbox – Felipe Valim Jun 16 '16 at 19:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.