G
G
Gourii2020-09-02 11:56:30
PHP
Gourii, 2020-09-02 11:56:30

How to setup phpvirtualbox?

I can’t set up phpvirtualbox in any way, all services are working, the site opens, but I can’t log in (I try admin / admin). I searched on the Internet, I did not find a solution.
5f4f58d3a59a6977629076.png

vbox web service

***@ServerUbuntu:~$ sudo service vboxweb status
● vboxweb.service - VirtualBox Web Service
Loaded: loaded (/lib/systemd/system/vboxweb.service; disabled; vendor preset: enabled)
Active: active (running) since Ср 2020-09-02 11:18:10 MSK; 19min ago
Process: 23367 ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vbox/vboxweb.pid --background (code=exited, status=0/SUCCESS)
Main PID: 23379 (vboxwebsrv)
Tasks: 18
Memory: 13.8M
CPU: 844ms
CGroup: /system.slice/vboxweb.service
├─23379 /usr/lib/virtualbox/vboxwebsrv --pidfile /run/vbox/vboxweb.pid --background
├─23381 /usr/lib/virtualbox/VBoxXPCOMIPCD
└─23386 /usr/lib/virtualbox/VBoxSVC --auto-shutdown

сен 02 11:18:10 ServerUbuntu systemd[1]: Starting VirtualBox Web Service...
сен 02 11:18:10 ServerUbuntu vboxwebsrv[23367]: Oracle VM VirtualBox web service Version 5.1.38_Ubuntu
сен 02 11:18:10 ServerUbuntu vboxwebsrv[23367]: (C) 2007-2019 Oracle Corporation
сен 02 11:18:10 ServerUbuntu vboxwebsrv[23367]: All rights reserved.
сен 02 11:18:10 ServerUbuntu systemd[1]: vboxweb.service: Supervising process 23379 which is not our child. We'll most likely not notice when it exits.
сен 02 11:18:10 ServerUbuntu systemd[1]: Started VirtualBox Web Service.

virtual box service

***@ServerUbuntu:~$ sudo service virtualbox status
● virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; bad; vendor preset: enabled)
Active: active (exited) since Ср 2020-09-02 11:16:48 MSK; 22min ago
Docs: man:systemd-sysv-generator(8)
Process: 23265 ExecStop=/etc/init.d/virtualbox stop (code=exited, status=0/SUCCESS)
Process: 23292 ExecStart=/etc/init.d/virtualbox start (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0

сен 02 11:16:48 ServerUbuntu systemd[1]: Starting LSB: VirtualBox Linux kernel module...
сен 02 11:16:48 ServerUbuntu virtualbox[23292]: * Loading VirtualBox kernel modules...
сен 02 11:16:48 ServerUbuntu virtualbox[23292]: ...done.
сен 02 11:16:48 ServerUbuntu systemd[1]: Started LSB: VirtualBox Linux kernel module.

/lib/systemd/system/vboxweb.service

***@ServerUbuntu:~$ cat /lib/systemd/system/vboxweb.service
[Unit]
Description=VirtualBox Web Service
After=network.target

[Service]
Type=forking
PIDFile=/run/vbox/vboxweb.pid
ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vbox/vboxweb.pid --background
User=virtualbox
Group=vboxusers

[Install]
WantedBy=multi-user.target


Service running and listening on port:

***@ServerUbuntu:~$ sudo netstat -tulpn |grep vbox
tcp6 0 0 ::1:18083 :::* LISTEN 23379/vboxwebsrv

Port 18083 open:

***@ServerUbuntu:~$ sudo ufw status |grep 18
18083/tcp ALLOW Anywhere
18083/tcp (v6) ALLOW Anywhere (v6)

Config.php is standard except for two lines:
var $username = 'virtualbox';
var $password = '***';

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Barbolin, 2020-09-02
@dronmaxman

tcp6 0 0 ::1:18083 :::* LISTEN 23379/vboxwebsrv
ipv6 listening?

G
Gourii, 2020-09-04
@Gourii

Found a solution to the problem.
1) Changed the /etc/default/virtualbox VBOXWEB_HOST file to the server IP
2) The same IP was registered in the /var/www/phpvirtualbox/config.php
file var $location = ' http://*.*.*.*: 18083/ ';
3) Deleted the file /lib/systemd/system/vboxweb.service , which I no longer need.
4) Because I use Supervisor , I made a config for it /etc/supervisor/conf.d/vboxweb.conf :
[program:vboxweb]
command=/usr/bin/vboxwebsrv -H Server IP
user=virtualbox (the user from which the virtualbox itself works, he must be in /etc/default/virtualbox)
process_name=%(program_name)s
numprocs=1
autostart=1
autorestart=1
redirect_stderr=true
5) Restarted Supervisor
As a result, everything works:
5f52448b4e152408487052.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question