RemoteBox
RemoteBox is an open source VirtualBox remote client, written in Perl. In essence, you can remotely administer an installation of VirtualBox on a server, including its guests and interact with them as if they were running locally. VirtualBox is installed on 'the server' machine and RemoteBox runs on 'the client' machine. RemoteBox provides a complete GTK graphical interface with a look and feel very similar to that of VirtualBox's native GUI. If you are familiar with other virtualization software, such as VMWare ESX, then think of RemoteBox as the "poor man's" VI client.
Installation
RemoteBox can be installed on the client with the remoteboxAUR package. It will pull in all the required GTK2 and Perl packages. However, an RDP client is also required, such as freerdp or rdesktop and needs to be manually installed. As of this writing, freerdp-gitAUR 2.0.0.beta1 has been tested and found working.
VirtualBox web service
To use RemoteBox, you must have VirtualBox installed on your server, along with virtualbox-ext-oracleAUR package. For a headless server not running a GUI, installing virtualbox-headlessAUR is suggested. It is also suggested to install virtualbox-guest-iso on your server too.
On your server running VirtualBox, create a new user with useradd, setting a homedir, which is required for storing VirtualBox settings and configurations for virtual machines, and a shell, because otherwise RemoteBox will not be able to login.
The rest of this page will assume a 'vbox' user with its primary group as 'vboxusers'.
Now give it a password and record it somewhere safe:
Create a custom vboxweb.service
by using a drop-in file as follows:
/etc/systemd/system/vboxweb.service.d/override.conf
[Service] PIDFile=/run/vboxweb/vboxweb.pid ExecStart= ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vboxweb/vboxweb.pid --host <your server ip> --background User=vbox Group=vboxusers
Create a tmpfile rule for your vboxweb.service
:
/etc/tmpfiles.d/vboxweb.conf
d /run/vboxweb 0755 vbox vboxusers
Manually create the /run/vboxweb
directory for first start vboxweb.service
:
# mkdir /run/vboxweb # chown vbox:vboxusers /run/vboxweb # chmod 755 /run/vboxweb
You can enable logging by editing the ExecStart line in the unit file above to include the
--logfile <logfile location>
directive. To enable verbose logging, you can also include the --verbose
directive.
Make sure the vbox user can create and write to the logile you are configuring.
Connecting RemoteBox to the vboxweb service
Open RemoteBox and click the Connect
button. Specify the following:
URL: http:<your server ip>:18083 Username: vbox Password: <password recorded earlier>
To make it easier to connect during future sessions, after logging in goto File
and create a new connection profile.
Troubleshooting
If you encounter a login problem connecting to the server, first check that the service is running.
From the server console, check vboxweb.service
unit status.
It should output that it is running. If not, check logging with journalctl and,
if you configured a logfile
, the vboxweb service logfile for any leads.
Even on verbose, vboxweb service might not give you any lead as to what is the problem.
In that case, you can become vbox
with su or sudo and run manually vboxwebsrv
from the command line.
[vbox]$ /usr/bin/vboxwebsrv --pidfile /run/vboxweb/vboxweb.pid --host <your server ip>
Omit the --background
and --logfile
directives. If the service starts, the problem could be
permissions to the log file. Leave it running and check if you can connect with RemoteBox from the client.
If you still cannot connect, you can stop the service with Ctrl-c
and start it with the
--background
directive. Next, check using netstat or something similar whether vboxwebsrv
is listening on port 18083. If you see a different port, try connecting your RemoteBox on that port instead.
Another reason could be a firewall, either on your server, or on your client.
If you are getting the following error message:
vboxwebsrv: error: failed to initialize COM! hrc=NS_ERROR_FAILURE
Check that your home directory is writable for the user 'vbox'. Also, check
the ~/.config/VirtualBox
file gets created and populated with configuration files.