Menu

vboxweb-service Configuration in Linux

Ian Moore

On Linux systems, VirtualBox creates the init script /etc/init.d/vboxweb-service when it is installed. This can be used to start and stop vboxwebsrv. While there may be numerous ways to configure this script, this document aims to keep it simple.

In order for vboxweb-service start vboxwebsrv, the file /etc/default/virtualbox must exist with correct settings. If this file does not exist on your system, create it now. This file has the format:

SETTING1=value
SETTING2=value

The following settings are available for use in this file:

Setting Description
VBOXWEB_USER The user as which vboxwebsrv will run.
VBOXWEB_HOST The host to bind to (localhost).
VBOXWEB_PORT The port to bind to (18083).
VBOXWEB_TIMEOUT Session timeout in seconds; 0 = disable timeouts (300).
VBOXWEB_CHECK_INTERVAL Frequency of timeout checks in seconds (5).
VBOXWEB_THREADS Maximum number of worker threads to run in parallel (100).
VBOXWEB_KEEPALIVE Maximum number of requests before a socket will be closed (100).
VBOXWEB_LOGFILE Name of file to write log to (no file).
INSTALL_DIR The location of the vboxwebsrv binary (/usr/lib/virtualbox).

At a minimum, VBOXWEB_USER and VBOXWEB_HOST must be set.

VBOXWEB_USER should be set to the user that runs VirtualBox virtual machines on your system. If more than one user runs virtual machines, you will have to pick one (multiple instances are possible, but beyond the scope of this document).

VBOXWEB_HOST should, in most cases, be set to 127.0.0.1. If phpVirtualBox (your web server) is not running on the same host as vboxwebsrv and phpVirtualBox must communicate with vboxwebsrv over a network, this must be set to the external IP address of the host runing vboxwebsrv.

Your /etc/default/virtualbox may look like this:

VBOXWEB_USER=vbox
VBOXWEB_HOST=127.0.0.1

.. or if your web server and vboxwebsrv are on NOT the same host:

VBOXWEB_USER=remote_vbox
VBOXWEB_HOST=192.168.0.4

Note that these values are just examples. The user that runs virtual machines on your system may not be named "vbox."

Once this is done, you may start and stop vboxwebsrv by running:

/etc/init.d/vboxweb-service start
-or-
/etc/init.d/vboxweb-service stop

as the root user on your system.


Discussion

  • Brad Thompson

    Brad Thompson - 2021-02-16

    so far so good, vboxwebsrv up an running started by vboxweb.service, /etc/default/virtualbox and config.php defined but still the legendary error below. Any help would be much appreciated! Thanks!

    An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder. The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered (e.g. location, username, or password).

    Depending on your PHP configuration, navigating directly to config.php in your web browser may display the PHP error message.

    If find that this is not the case, or have no idea what this error message means, please raise the issue at http://sourceforge.net/p/phpvirtualbox/discussion/help/

     
  • Brad Thompson

    Brad Thompson - 2021-02-18

    When I change from myipadrress to 127.0.0.1 and viceversa I get the login and enter admin/admin but get the error below. The vboxwebserver is up and the config.php is modified accordingly. What is wrong?

    Oracle VM VirtualBox VM Selector v6.1.16_Ubuntu

    PhpVirtualBox 5.0-5 2016-01-08

    etc/default/virtualbox:

    LOAD_VBOXDRV_MODULE=1

    VBOXWEB_USER=brad
    VBOXWEB_GROUP=vboxusers
    VBOXWEB_HOST=127.0.0.1

    PHP 7.4.9 (cli) (built: Oct 26 2020 15:17:14) ( NTS )

    libapache2-mod-php7.4 is already the newest version (7.4.9-1ubuntu1.1).

    vboxwebsrv is running and is listening:
    tcp 0 0 127.0.0.1:18083 0.0.0.0:* LISTEN 0 727122 11337/vboxwebsrv

    There was an error obtaining the list of registered virtual machines from VirtualBox. Make sure vboxwebsrv is running and that the settings in config.php are correct.

    The list of virtual machines will not begin auto-refreshing again until this page is reloaded.

    HTTP error: 500 Internal Server Error
    Details

    readyState: "4"
    responseText: ""
    status: "500"
    statusText: "Internal Server Error"

    the log file:

    00:00:00.039894 main VirtualBox web service 6.1.16_Ubuntu r140961 linux.amd64 (Dec 17 2020 22:06:23) release log
    00:00:00.039905 main Log opened 2021-02-19T01:02:40.234693000Z
    00:00:00.039907 main Build Type: release
    00:00:00.039913 main OS Product: Linux
    00:00:00.039916 main OS Release: 5.8.0-31-generic
    00:00:00.039918 main OS Version: #33-Ubuntu SMP Mon Nov 23 18:44:54 UTC 2020
    00:00:00.039990 main DMI Product Name: HP 15 Notebook PC
    00:00:00.040015 main DMI Product Version: 0974100002405F00000620180
    00:00:00.040038 main Firmware type: BIOS
    00:00:00.040172 main Host RAM: 3826MB (3.7GB) total, 1375MB available
    00:00:00.040178 main Executable: /usr/lib/virtualbox/vboxwebsrv
    00:00:00.040179 main Process ID: 8869
    00:00:00.040180 main Package type: LINUX_64BITS_GENERIC (OSE)
    00:00:00.241060 main IPC socket path: /tmp/.vbox-root-ipc/ipcd
    00:00:01.548109 SQPmp Socket connection successful: host = 127.0.0.1, port = 18083, master socket = 9
    00:00:06.515677 Watchdog Statistics: 0 websessions, 0 references
    00:01:41.836230 SQPmp Request 1 on socket 10 queued for processing (1 items on Q)
    00:01:41.836325 SQW01 New SOAP thread started
    00:01:41.836389 SQPmp Request 2 on socket 11 queued for processing (2 items on Q)
    00:01:41.836429 SQW01 Processing connection from IP=127.0.0.1 socket=10 (0 out of 1 threads idle)
    00:01:41.836902 SQPmp Request 3 on socket 12 queued for processing (2 items on Q)
    00:09:25.294865 SQW03 Processing connection from IP=127.0.0.1 socket=10 (5 out of 6 threads idle)

     

    Last edit: Brad Thompson 2021-02-19

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.