How to install phpvirtualbox on Debain 9.0 (Stretch)
June 28, 2017
Phpvirtualbox is a web applicaton that allows you to manage Oracle’s Virtualbox VMs. Although Phpvirtual box is currently (As of 28-06-2017)
a verion behind Virtualbox development, a simple workaround can be applied.
First we need to install Apache and PHP (Plus its components.) in order to serve Phpvirtualbox:
Next we can install the latest version of virtualbox from Oracle’s debian repositories:
Then we add the Virtualbox pub key
Now we are able to install Virtualbox
In order to use the built in rdp client, usb 2&3, plus some other features, we need to install the Virtualbox Extension Pack
In order to allow phpvirtualbox the ability to access the vboxwebserver, we need to create a user that belongs to the vboxusers group.
Phpvirtualbox uses a service called vboxwebsrv provided by Virtualbox to manage all the aspects of a VM. This service is not enabled by default, so we need to
make it start at boot
The file should look like this:
Now we need to enable the execute bit and tell init to run the file at boot
The Virtualbox internals are now finished! We can proceed to the phpvirualbox setup.
We need to tell phpvirtualbox which user to run as, in this case we will use the user we created earlier ‘vbox’
This is what the file should look like once you are done:
When installing phpvirtualbox I generally change apache’s default document root to /var/www/html/phpvirtualbox, but this is a matter of preference, if you wish
to do so, run the following commands.
At this point you could reboot and point your browser to your server, but you would get a version missmatch error, in order to rectify this, you must apply a
workaround
Then add a symbolic link to the following files.
After running the last commands and rebooting, you should be able to access the phpvirtualbox interface at the server’s ip or domain name.
Congratulations! You now have a working phpvirtualbox install!