Home Open Source Tools Install phpVirtualBox to Manage and Access Virtualbox VM’s

Install phpVirtualBox to Manage and Access Virtualbox VM’s

In previous articles, we have seen how to work with VirtualBox core features that come with the VirtualBox package. We have seen how to create Guest Virtual Machines, Different Networking options, how to protect your VM with snapshots, and how to clone VM, import, and export your virtual machines. This is going to be the last article of this VirtualBox series.

phpVirtualBox is a web implementation of VirtualBox implemented in AJAX and the user interface is created with PHP. This is an open-source project and is not supported by oracle. phpVirtualBox allows you to use and control VirtualBox in a headless environment.

In this article, we are going to see how to install phpVirtualBox in different Linux flavors to manage and access remote VirtualBox machines from the web browser.

Install Apache and PHP in Linux

The first step is to make sure the system is up to date before installing the packages.

$ sudo apt update       [On Debian-based distros]
$ sudo yum update       [On RHEL-based distros]

Then you need to install PHP and Apache webserver package.

------- On Debian-based distros ------- 
$ sudo apt install apache2 php php-common php-soap php-gd          

------- On RHEL-based distros -------
$ sudo yum install httpd php php-devel php-common php-soap php-gd  [On RHEL-based distros]

Now start the apache service.

$ sudo systemctl restart apache2.service  [On Debian-based distros]
$ sudo systemctl restart httpd.service    [On RHEL-based distros]

Now to test if the apache installation is working fine go to your browser and type the following address which will show the default apache web page.


If you are not able to access the webpage then you need to adjust your firewall settings to allow HTTP traffic on port 80.

------- On Debian-based distros ------- 
$ sudo ufw allow http

------- On RHEL-based distros -------
$ firewall-cmd --zone=public --permanent --add-service=http

Install phpVirtualBox in Linux

Now download PHPvitualbox from sourceforge.net and install it. Either download the zip folder directly from the site or run the wget command as given below. The preferred method is downloading directly from the website as the version and download link may vary from time to time.

$ wget https://sourceforge.net/projects/phpvirtualbox/files/latest/download -O phpvirtualbox.zip
$ unzip phpvirtualbox.zip

Now move the extracted phpvirtualbox folder to the Apache webserver root folder.

sudo mv phpvirtualbox-* /var/www/html/phpvirbox

Rename config.php-example file to config.php.

$ sudo mv /var/www/html/phpvirbox/config.php-example /var/www/html/phpvirbox/config.php

Create a new user or add an existing user in the vboxusers group and change the ownership.

$ sudo usermod -aG vboxusers karthick
$ sudo chown -R karthick:karthick /var/www/html/phpvirbox

Now we have to add a username and password in the config.php file.

$ sudo nano /var/www/html/phpvirbox/config.php

Add the below lines to the config.php file.

var $username = 'karthick';
var $password = 'password';

Next, you need to open or create a new virtualbox file under /etc/default/ directory:

$ sudo nano /etc/default/virtualbox

Add the following line and make sure to replace the username.


Finally, restart the following services to apply the configuration changes.

$ sudo systemctl restart vboxweb.service
$ sudo systemctl restart apache2

Access phpVirtualBox from Web

Now start the virtualbox webserver.

$ vboxwebsrv -H

Now go to the browser and type the following URL to access the webpage. The default username and password will be admin, admin.

phpVirtualBox Login
phpVirtualBox Login

Now you can start creating your Virtual Machines from phpVirtualBox web browser as you would do from VirtualBox manager.

That’s it for this article. We hope you loved the VirtualBox series. We would love to hear your valuable feedback in whatever ways we can help the community to deliver better content.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

1 thought on “Install phpVirtualBox to Manage and Access Virtualbox VM’s”

  1. Your instructions do not work. I have copied and pasted everything with the exception of the user I created.

    I am on Ubuntu Server 22.04.2 LTS, and loaded the virtual box (Which you fail to instruct me to install) and Apache and php from the packages available.

    Output from starting the vboxwebsrv:

    $ vboxwebsrv -H
    racle VM VirtualBox web service Version 6.1.38_Ubuntu
    (C) 2007-2022 Oracle Corporation
    All rights reserved.
    00:00:00.000268 main     VirtualBox web service 6.1.38_Ubuntu r153438 linux.amd64 (Sep  7 2022 11:18:57) release log
    00:00:00.000274 main     Log opened 2023-04-19T20:05:59.593492000Z
    00:00:00.000277 main     Build Type: release
    00:00:00.000283 main     OS Product: Linux
    00:00:00.000286 main     OS Release: 5.15.0-70-generic
    00:00:00.000289 main     OS Version: #77-Ubuntu SMP Tue Mar 21 14:02:37 UTC 2023
    00:00:00.000371 main     DMI Product Name: GA-78LMT-USB3 6.0
    00:00:00.000399 main     DMI Product Version:
    00:00:00.000433 main     Firmware type: BIOS
    00:00:00.000528 main     Host RAM: 24023MB (23.4GB) total, 23737MB (23.1GB) available
    00:00:00.000535 main     Executable: /usr/lib/virtualbox/vboxwebsrv
    00:00:00.000537 main     Process ID: 1568
    00:00:00.000538 main     Package type: LINUX_64BITS_GENERIC (OSE)
    vboxwebsrv: error: failed to initialize COM! hrc=NS_ERROR_FAILURE

    If I start it as root (sudo vboxwebsrv -v) it starts with no errors, but the web page says there is a problem with the config.php file.

    So what is missing? Any ideas?



Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.