The documentation assumes the following:
For example, if the agent is running as the user joe, then you will see Joe's virtual machines and configuration, regardless of the credentials you connected with. It's also worth mentioning that extensions such as the Oracle VM VirtualBox Extension Pack may also need to be installed as this user, so that it's available in their configuration. You may already have an existing user you wish to use, or you can create a new one specifically for the purpose. If you are not sure how to create a user, please consult the documentation for your operating system.
For the purposes of this documentation, we will use the following values in the examples, however remember to change them to suit your setup.
vboxwebsrvuser: | virtualuser • This user should also be a member of the vboxusers group. This group is usually created by VirtualBox at install time |
Server Name: | myserver.example.com |
Server IP Address: | 192.168.1.10 |
Default TCP Port: | 18083 |
• The following commands configure the VirtualBox web service. Change the user and hostname as appropriate to suit your configuration. You can use the IP address instead of the hostname, if your hostname is not in DNS
svccfg -s svc:/application/virtualbox/webservice:default setprop config/user=virtualuser
svccfg -s svc:/application/virtualbox/webservice:default setprop config/timeout=integer: 0
svccfg -s webservice:default setprop config/logfile=astring: /var/log/vboxwebservice.log
svccfg -s svc:/application/virtualbox/webservice:default setprop config/host=myserver.example.com
svcadm refresh svc:/application/virtualbox/webservice:default
• Initialise and set the correct ownership of the log file. If the log file is missing or cannot be written to, the VirtualBox web service will not start correctly.
touch /var/log/vboxwebservice.log
chown virtualuser:vboxuser /var/log/vboxwebservice.log
• Start the VirtualBox web service and enable it on boot
svcadm enable svc:/application/virtualbox/webservice:default
If the service fails to start, recheck the configuration steps. Checking the contents of /var/log/vboxwebservice.log may give you some clues. You can also run the following command for more diagnostic information
svcs -x svc:/application/virtualbox/webservice:default
You should now be able to connect to the server using the RemoteBox client.
• Edit or create the following configuration file, using your preferred text editor
/etc/default/vb-autostart-perms
• Add the following contents to the configuration file
default_policy = allow
• Set the correct file permissions and create the autostart database
chmod 0644 /etc/default/vb-autostart-perms
chown virtualuser:vboxusers /etc/default/vb-autostart-perms
mkdir -p /var/lib/virtualbox-autostart
chmod 1777 /var/lib/virtualbox-autostart
chown virtualuser:vboxusers /var/lib/virtualbox-autostart
• Edit or create this configuration file with your preferred text editor to add the configuration options
/etc/default/virtualbox
• Add the following contents to the configuration file
VBOXAUTOSTART_DB="/var/lib/virtualbox-autostart"
VBOXAUTOSTART_CONFIG="/etc/default/vb-autostart-perms"
• Configure the service as follows
svccfg -s svc:/application/virtualbox/autostart:default setprop config/config=/etc/default/virtualbox
• Enable and start the auto-start service.
svcadm enable svc:/application/virtualbox/autostart:default
• You will also need to connect to the server with RemoteBox and set your preferences to use these configurations as shown below.
• You will also need to connect to the server with RemoteBox and set your preferences to use these configurations as shown below.
• To disable authentication, run the following command on the server as the same user that the VirtualBox web service runs as:
vboxmanage setproperty websrvauthlibrary null