# vboxwebsrv



## none (Dec 24, 2017)

Hi,

anyone know how to make this service work?

I can't find manual for it or the url to access it.

The vboxwebsrv service through rc.d won't work at all. I can only run it by running from CLI, but then no access 

Has anyone ever had this service running on FreeBSD?

thanks,

none


----------



## derekschrock (Dec 24, 2017)

Yes, I use it with www/phpvirtualbox look at /tmp/vboxweb I believe this is the default location this service logs to.


----------



## none (Dec 24, 2017)

derekschrock said:


> Yes, I use it with www/phpvirtualbox look at /tmp/vboxweb I believe this is the default location this service logs to.


Hi derek,

thanks for the input. I have no file at /tmp/vboxweb 

my rc.conf section for it is:

```
# VBox
vboxnet_enable="YES"
devfs_system_ruleset="system"
vboxheadless_enable="YES"
vboxwebsrv_enable="YES"
```

and all I get when restarting is:


```
root@floyd:/tmp # /usr/local/etc/rc.d/vboxwebsrv restart
vboxwebsrv not running? (check /var/run/vboxwebsrv.pid).
Starting vboxwebsrv.
root@floyd:/tmp # /usr/local/etc/rc.d/vboxwebsrv restart
vboxwebsrv not running? (check /var/run/vboxwebsrv.pid).
Starting vboxwebsrv.
root@floyd:/tmp #
```

I get no other sign here 

Is there any other line for rc.conf I need?

thanks,

none

PS: BTW, I got it running by forcing vboxwebsrv from command line and letting it be inside a screen terminal. But when I reboot I need to call it again by myself


----------



## derekschrock (Dec 24, 2017)

Sorry I should have looked at my /etc/rc.conf before saying that.  That's where I'm logging to so it's not default.  Adding a -F to vboxwebsrv_flags will tell vboxwebsrv where to log to.


```
vboxwebsrv_flags="-F /tmp/vboxweb"
```


----------



## derekschrock (Dec 24, 2017)

Also can you provide the output of `kldstat`?  Is the vboxdrv.ko kld loaded?


----------



## none (Dec 30, 2017)

Hi derek,

sorry for the delay. I really don't know how, but it worked fine if I tried it running vboxwebsrv from command line. After some reboots, now I have it all working fine. Thanks for your support 
And a great new year!

Next step, on Monday, will be figure how start my VM just after boot.

Thanks again.

none


----------



## derekschrock (Dec 30, 2017)

Good.  You want to look at /usr/local/etc/rc.d/vboxheadless


----------



## AndrewManson (Jan 5, 2021)

none said:


> ... I really don't know how, but it worked fine if I tried it running vboxwebsrv from command line. After some reboots, now I have it all working fine. Thanks for your support
> And a great new year!
> 
> Next step, on Monday, will be figure how start my VM just after boot.


Hi all, 
I have the same question ("how to work with vboxwebsrv"). I'm using 12.2 release, may be - something has been changed since 2017... 

Well, here is my kldstat output (I have `vboxdrv_load="YES"` in my /boot/loader.conf):

```
root@fileserver_2:/tmp # kldstat
Id Refs Address                Size Name
 1   24 0xffffffff80200000  227ad00 kernel
 2    1 0xffffffff8247b000     3c70 speaker.ko
 3    1 0xffffffff8247f000    27c00 geom_mirror.ko
 4    1 0xffffffff824a8000     7840 nullfs.ko
 5    3 0xffffffff824b0000    88b88 vboxdrv.ko
 6    1 0xffffffff82539000   100fb0 ispfw.ko
 7    1 0xffffffff82921000     87d0 tmpfs.ko
 8    2 0xffffffff8292a000     2ce0 vboxnetflt.ko
 9    2 0xffffffff8292d000     9bd0 netgraph.ko
10    1 0xffffffff82937000     1770 ng_ether.ko
11    1 0xffffffff82939000     3f30 vboxnetadp.ko
12    1 0xffffffff8293d000      acf mac_ntpd.ko
```

My /etc/rc.conf:

```
vboxnet_enable="YES"
vboxwebsrv_enable="YES"
vboxwebsrv_user="vboxusers"
vboxwebsrv_flags="-P /tmp/vboxwebsrv.pid -F /tmp/vboxwebsrv.log -R 5"
```

And vboxwebsrv's log (/tmp/vboxwebsrv.log):

```
root@fileserver_2:/tmp # cat /tmp/vboxwebsrv.log
VirtualBox web service 5.2.44 r139111 freebsd.amd64 (Dec 24 2020 19:25:40) release log
00:00:00.000384 main     Log opened 2021-01-05T11:19:38.964754000Z
00:00:00.000389 main     Build Type: release
00:00:00.000411 main     OS Product: FreeBSD
00:00:00.000425 main     OS Release: 12.2-RELEASE-p1
00:00:00.000438 main     OS Version: FreeBSD 12.2-RELEASE-p1 GENERIC
00:00:00.000475 main     Host RAM: 16310MB (15.9GB) total, 15424MB (15.0GB) available
00:00:00.000485 main     Executable: /usr/local/lib/virtualbox/vboxwebsrv
00:00:00.000487 main     Process ID: [B]973[/B]
00:00:00.000488 main     Package type: BSD_64BITS_GENERIC (OSE)
```
As a result there is no process with PID=973, nothing new in "ps" or "sockstat" output :-(
Using `/usr/local/etc/rc.d/vboxwebsrv status` shows, that `vboxwebsrv is not running`.
Using `/usr/local/etc/rc.d/vboxwebsrv start` does nothing new (it just creates new /tmp/vboxwebsrv.log with the same content, but there is nothing new in "ps" or "sockstat" output).

I expect to get light http/https access to vbox management (like shellinabox has, see https://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/). 

Could it be that my expectations are wrong, and vboxwebsrv requires PHP and additional HTTP server ?


----------



## derekschrock (Jan 5, 2021)

I'm suspect of the vboxusers user.  I've never ran vboxwebsrv as that user and it not having a home dir might be an issue.

I would create a new user that in the vboxusers group and try to rerun vboxwebsrv with that user changed in rc.conf

And yes vboxwebsrv only provides access to the host vbox via a SOAP API.  It doesn't have a user interface like the virtualbox GUI.  You would need something that talks to vboxwebsrv such as phpvirtualbox or remotebox.

Also you don't need to user -P here.  The service will create a pid files in /var/run.


----------



## marcinkk (Jul 20, 2022)

Hi,

I had a problem with phpvirtualbox after upgrade to verison 6.1. I did not know what was the cause of the problem and came across this thread as part of my search - I was expecting problems with vboxwebsrv. The solution was a little strange. I had to change in ./phpvirtualbox/config.php the line: 
	
	



```
var $location = 'http://127.0.0.1:18083/';
```
 to: 
	
	



```
var $location = 'http://localhost:18083/';
```

Regards, Marcin


----------

