With VirtualBox installed on a headless server, you’ll need to tool to help create and manage virtual guest machines easily. One can use a remote desktop connection as we described in our previous post, but if you need to manage multiple guest machines, then phpVirtualBox is the way to go. Again, Virtualization software like VirtualBox and VMware Workstation Pro or VMware Players allow users to run multiple guest operating systems simultaneously on a single host computer. We’ve also described instructions to install this popular virtualization software on Ubuntu and Windows systems on this website. To get started with managing VirtualBox headless servers via phpVirtualBox, continue below:
Prerequisites – Install VirtualBox
Before you can install phpVirtualBox, you must first install VirtualBox. The link below shows you how to do just that. Now that VirtualBox is installed, your next step is to get phpVirtualBox installed.
Install Apache2 HTTP Server
After installing VirtualBox as described in our previous post, run the commands below to install the Apache2 HTTP server.
Install PHP 7.1 and Related Modules
PHP 7.1 isn’t available on Ubuntu default repositories… to install it, you will have to get it from third-party repositories. Run the commands below to add the below third party repository to upgrade to PHP 7.1 Then update and upgrade to PHP 7.1 Run the commands below to install PHP 7.1 and related modules. After installing PHP 7.1 modules, run the commands below to open the Apache2 PHP default configuration file. Then add the lines below just before Dynamic Extensions Save the file and exit. Reload Apache2 HTTP Server
Install phpVirtualBox
Finally, run the commands below to download the phpVirtualBox package After downloading, run the commands below to unzip the package, and copy it to the Apache2 default document root directory. Next, create a phpVirtualBox configuration file from its sample file by running the commands below.
Create a phpVirtualBox dedicated user account
phpVirtualBox requires a dedicated user account to manage the VirtualBox. For that, you need to create a service account. To create a service account called vbox and add the user to the vboxusers group. by running the commands below and running the second line to create a new password. Next, set the permissions for the phpVirtualBox directory for the vbox user
Setup phpVirtualBox connection
The final step is to configure the phpVirtualBox user connection. This can be done by opening its default configuration file and adding phpvbox user to the settings. Open and edit the file by running the commands below: Then fill in the user account for phpvbox as shown below. Next, run the commands below to open VirtualBox config file in the /etc/default directory. Then add these lines at the end of the file, then save it. This allows VirtualBox SOAP API service to run as vbox. Start the phpVirtualBox service account by running the commands below. Restart the Apache2 server, then browse to the host via IP or hostname followed by /phpvirtualbox This is how to manage VirtualBox remotely. Enjoy! You may also like the post below: