My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
vboxwebServiceConfigLinux  
How to configure /etc/init.d/vboxweb-service (VirtualBox >= 4.0)
Deploy
Updated Feb 23, 2011 by imooreya...@gmail.com

Introduction

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.

Details

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 must be set. Some may need to set VBOXWEB_HOST as well.

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 be set if phpVirtualBox (your web server) is not running on the same host as vboxwebsrv. If phpVirtualBox must communicate with vboxwebsrv across a network, this must be set to an IP address reachable by your web server. If your web server and vboxwebsrv are running on the same host, you may exclude this setting.

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

VBOXWEB_USER=vbox

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

VBOXWEB_USER=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.

Comment by diazleon...@gmail.com, Feb 12, 2011

To start the service at boot you need to do

  sudo update-rc.d vboxweb-service defaults (Debian, Ubuntu)

or chkconfig (sorry I don't have the details)

Comment by purer...@gmail.com, Feb 13, 2011

if u can't start vboxweb-service, try to adduser on linux system Example: adduser 'vbox' and password 'vbox'

Comment by billwest...@gmail.com, Feb 17, 2011

I had to add quotes to the user name in vbox.cfg before I could connect: VBOXWEB_USER='vbox'

Comment by yamugot...@gmail.com, Feb 20, 2011

i fllowed all the step. but i get this error: SOAP-ENV:ClientHTTP GET method not implemented

os : debian 6 virtualbox 4

user vbox created and is in group vboxusers i also create a file /etc/default/virtualbox which content: VBOXWEB_USER=vbox VBOXWEB_HOST=192.168.1.89

Please some one any advice or solution thank you

Comment by project member imooreya...@gmail.com, Feb 20, 2011

@yamugot - You are probably going to http://192.168.1.89:18083/phpvirtualbox when you need to go to http://192.168.1.89/phpvirtualbox/

Comment by yamugot...@gmail.com, Feb 21, 2011

thank you for your quick answer immoreya, but the problem not resolve yet. error msg : Google Chrome could not connect to 192.168.1.89 when i click http://192.168.1.89/phpvirtualbox/

I using debian os 6 with minimum installation and no graphical Do i need install php or apache to make to works. By the way, i installed flubox just to create vm machine with graphical mode, but i do not see any vb menu in flubox.... please help me out... any good solution are welcome

Comment by rothr...@gmail.com, Feb 27, 2011

yamugot - with that google response - that tells me Chrome is not finding a web server installed on .89 - if you are using the VM for the web server fine - but you will need to take special attention to the vbox configure as above since your vb and phpweb are different hosts. also special configuration in config.php in phpvirtualbox web dir.

yes - you need php and apache or some web server installed - for ease on yourself, install all on same server.

Comment by rothr...@gmail.com, Feb 27, 2011

diazleon - for chkconfig, the command would be "chkconfig vboxweb-service on" or "chkconfig ---levels 2345 vboxweb-service on" - either way, then to start it - "service vboxweb-service start"

Comment by project member imooreya...@gmail.com, Feb 28, 2011

@yamugot - this really isn't the place for support issues. Please use the Issues tab.

But as long as we're here... you must install apache and php in Debian.

apt-get install apache2-mpm-prefork apt-get install libapache2-mod-php5

Place the phpvirtualbox folder in /var/www. Call it phpvirtualbox if it is not already named that. It should then be accessible at http://192.168.1.89/phpvirtualbox/

Again, if you have any trouble, please create an entry on the Issues tab.

Comment by yamugot...@gmail.com, Mar 4, 2011

i will try it and if I still have problem, I will post on the Issues Tab. Thank you all for your kind help

Comment by larsen...@web.de, Apr 1, 2011

In case you only get a "failed" when you try to start vboxwebsrv via the init script and you have VBOXWEB_LOGFILE configured, check the permissions on that file. It must be writable for VBOXWEB_USER.

Comment by f...@flagbit.de, Apr 4, 2011

If you created a user to run the vboxes make sure the user has a writable $HOME

Comment by ignaciog...@gmail.com, May 4, 2011

I have suse 11.4 and i have the same problem, i setup /etc/default/virtualbox with the vbox machine user, but when i loggin on phpvirtualbox i have this error "Error logging in to vboxwebsrv" i try with root user on /etc/default/virtualbox, and work, except i haven't any virtual machine with this user.

Perhaps is a permissions problem?

Comment by project member imooreya...@gmail.com, May 4, 2011
Comment by billwest...@gmail.com, May 4, 2011

It seems like getting the permissions right for this process is a HUGE stumbling block...perhaps someone could document whats going on "under the hood" regarding permissioning. Every distro seems to have a different gotcha that borks piece this up.

I'm trying to get this running under Ubuntu Server 10.04 and it looks like I'll need to set aside an entire day to chase this rabbit, again.

Comment by project member imooreya...@gmail.com, May 4, 2011

Keep in mind this is a VirtualBox? issue and not a phpVirtualBox issue.

This is how far I got the last time - It seems that authenticating against PAM wants to read /etc/shadow. This file is only readable by root and should remain that way. If your distro's standard PAM authentication uses pam_unix.so, you will not have a problem. pam_unix.so runs a setuid root helper (so can read /etc/shaddow) to authenticate. If it uses pam_unix2.so, then you will have a problem. This does not run a setuid helper. grep pam_unix /etc/pam/common-auth (in debian at least - should work in ubuntu as well) to find out which it uses. The documentation of pam_unix2.so says something to the effect of the requesting program should run a setuid helper to authenticate. vboxwebsrv does not do this, so cannot authenticate.

If it uses pam_unix2.so, you can follow the instructions for Suse in the Installation wiki to get vboxwebsrv to work.

Another option is to google 'VirtualBox? PAM authentication'. This looks interesting in particular: http://forums.virtualbox.org/viewtopic.php?p=22619

Comment by hmronl...@gmail.com, May 6, 2011

I've recently installed Ubuntu Natty 64bits and VirtualBox? OSE 4.04 and found that /etc/init.d/vboxweb-service file is missing. Where can I get it ?

Thanks, Hernán.-

Comment by jba...@gmail.com, May 13, 2011

Yeah, got it running on Ubuntu 10.04 Works great.

Make sure you don't have typo's and:

If you don't see "Remote Display" tab with VirtualBox? >= 4.0, run as vbox user 'VBoxManage modifyvm "VM name" --vrde on'

Comment by feloniu...@gmail.com, May 24, 2011

I'm not part of this group but here are some findings of mine. For anyone having problems getting the service to start who has enabled logging be sure and create the log file neither the init script or the service will create it.

touch /var/log/vbox.log chown vboxuser:vboxuser /var/log/vbox.log

You can test where the init script is failing by running it like this and looking at the result.

bash -x /etc/init.d/vboxweb-service

Don't forget to setup a log rotate config for vboxweb.

Also for "I've recently installed Ubuntu Natty 64bits and VirtualBox? OSE 4.04 and found that /etc/init.d/vboxweb-service file is missing. Where can I get it ?

Thanks, Hernán.- "

Did you use the oracle apt repository to install virtualbox?

Thanks, John

Comment by a...@f0rmat.com, May 28, 2011

I'm running 11.04 Ubuntu x64 Desktop and the file vboxweb-service does not exist even though I have virtualbox installed

Comment by mdarifu...@gmail.com, Jul 14, 2011

Hi I am trying to install phpvirtualbox in ubuntu 10.10 but when i try to restart the vboxweb-service it shows that "VirtualBox? kernal module not loaded!". What is the solution for that.

Comment by project member imooreya...@gmail.com, Jul 14, 2011

If you have any problems, please use the Issues tab to create an issue.

Comment by sebak...@gmail.com, Aug 4, 2011

If the webservice fails to start, check if you have loggin enabled in your configuration. If you change the log-path, make sure the logfile exists and that the user running the webservice has access to it.

Took me a while to figure that one out because vboxweb-service didn't show any error.

Comment by Abihe...@gmail.com, Dec 8, 2011

its 'chkconfig add service name'.... assuming you added the proper headers (run levels, description, yadda)

Comment by themelon...@gmail.com, Jan 23, 2012

Thanks to feloniu...@gmail.com, May 24, 2011 I found that the service was failing to start due to permissions on the logfile location it was attempting to write/create. The suggestion for debugging information (bash -x /etc/init.d/vboxweb-service) was very helpful. My internal write-up goes like this:

If the Daemon seems to be running (sites are up) but the Web UI is down

2012-01 after a full restart, the hosted machines & sites responded, but the admin console didn't. The console? was up, but trying to authenticate returned "Could not connect to host" (the web UI trying to connect to the local daemon on http://127.0.0.1:18083/

/etc/init.d/vboxweb-service restart

returned "failed"

It seems that the web service vboxwebsrv was unable to write to its logs, and so failing to start. The log file was expected to be /var/log/vboxweb.log (configured in the config file )

Troubleshooting help in a forum suggested that the log file must be created and set writable. Starting the service manually (which is what the init script does eventually gave the clues to confirm this was the problem.

su vbox /usr/lib/virtualbox/vboxwebsrv --background -F /var/log/vboxweb.log

... this displayed the actual error:

vboxwebsrv: error: failed to open release log (could not open file '/var/log/vboxweb.log' (fOpen=0x322), VERR_ACCESS_DENIED)

Some commands like

sudo touch /var/log/vboxweb.log; sudo chown vbox:vboxusers /var/log/vboxweb.log
sorted that out, and the web service was then able to start. Not sure if this will happen again.


Sign in to add a comment
Powered by Google Project Hosting