By default vboxweb.service is only listening on the ipv6 local address ::1. I need this service to listen on all ipv4 addresses so I can use the service remotely.
user@vboxhost:~$ netstat -nl |grep 18083 tcp6 0 0 ::1:18083
:::* LISTEN
Editing the /etc/default/virtualbox config file as per Virtualbox documentation (chapter 9.21.1) does not seem to work:
user@vboxhost:~$ cat /etc/default/virtualbox
# Defaults for virtualbox initscript
# sourced by /etc/init.d/virtualbox
# installed at /etc/default/virtualbox by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Set this to 1 if you would like the virtualbox modules to be loaded by
# the init script.
LOAD_VBOXDRV_MODULE=1
# SHUTDOWN_USERS="foo bar"
# check for running VMs of user 'foo' and user 'bar'
# 'all' checks for all active users
# SHUTDOWN=poweroff
# SHUTDOWN=acpibutton
# SHUTDOWN=savestate
# select one of these shutdown methods for running VMs
# acpibutton and savestate causes the init script to wait
# 30 seconds for the VMs to shutdown
SHUTDOWN_USERS=""
SHUTDOWN=poweroff
# Custom vboxweb config
VBOXWEB_USER=vbox
VBOXWEB_HOST=0.0.0.0
VBOXWEB_PORT=18083
No change after restarting the service:
user@vboxhost:~$ sudo systemctl restart vboxweb.service
user@vboxhost:~$ netstat -nl |grep 18083
tcp6 0 0 ::1:18083 :::* LISTEN
I've also tried to change the port via /etc/default/virtualbox, this also does not work.
Note: I edited the /lib/systemd/system/vboxweb.service startscript to pass the '–host 0.0.0.0' argument. this works, but I don think this is the right approach.
Best Answer
I think your change to
/etc/init.d/virtualbox
does not work because that is not sourced bysystemd
. Try this.custom-host.conf
.The contents of the file would be:
Then:
Using these kinds of files is described at in man systemd.unit:
Setting environment variables is documented in man systemd.exec