I've recently updated a headless server to Ubuntu Server 15.10.
- Basic Ubuntu Server
- Xubuntu minimal install
I've installed virtualbox 5.0.14 from default Ubuntu sources.
I've downloaded and installed
I've defined a user
vbox in group
vboxusers, and basically virtualbox itself works fine. But I want it to be remotely configurable by using phpvirtualbox.
I downloaded and installed
I added the
VBOXWEB_USER=vbox to file
sudo netstat -peanut, it looked like vboxwebsrv was not using the correct IP address. It showed the local address as
::1:18083 instead of the expected
After some googling, I added
VBOXWEB_HOST=192.168.1.12 to file
/etc/default/virtualbox, but still no change after restarting the service.
However, if I stopped the service with
sudo systemctl stop vboxweb.service and started it manually with
sudo vboxwebsrv -H 192.168.1.12, that worked fine.
sudo netstat -peanut now reported it with the expected IP/port adress.
Most of the documentation I looked at referred to init.d and I started thinking that perhaps systemd does not use the
/etc/default/virtualbox file... I found that I could edit the file
/lib/systemd/system/vboxweb.service, and added a
-H 192.168.1.12 to the
After a restart of the vboxweb service, it worked! :o)
Enabled service so that it would start automatically at boot time:
sudo systemctl enable vboxweb.service
But after rebooting, there was no vboxweb showing in
sudo netstat -peanut at all, although ps -ef showed the service started:
root 1383 1 0 mars02 ? 00:00:00 /usr/lib/virtualbox/vboxwebsrv --pidfile /run/vboxweb.pid --background -H 192.168.1.12 -p 18083
A restart of the service will fix it, but it will not come up correctly after reboot.
So I was thinking that perhaps the vboxweb.service was started too early in the systemd initialization process.
So I edited the
vboxweb.service file again, with
After=apache2.service (and later also tried
After=multi-user.target), and verified with
systemd-analyse plot that the init of vboxweb was indeed moved to the very end of the initialization sequence. But still, wboxweb was not listed in
So finally to my questions:
- Are there conflicts between init.d and systemd, e.g. that virtualbox (from standard Ubuntu sources) relies on files that are init.d specific, while Ubuntu has moved on to systemd?
- Any other reason why the
VBOXWEB_HOSTsetting in the
/etc/default/virtualboxfile had no effect?
- Was it correct to edit the vboxweb.service file (specifically with the host parameter).
- (and this is the important one) How do I get vboxweb service up and running with correct IP/port settings at boot time? I am all out of ideas :/
PS: I know I could have shortened this post a lot, and just kept the main question here, as I have resolved the rest (leaving only a couple of questions), but I thought it could be interesting for others to see how I've worked on this problem.