Menu
InformatiWeb
  • Index
  • Courses
  • Tutorials
  • InformatiWeb Pro

Login

Registration Password lost ?
FR
  • IT
    • Articles
    • Backup
    • BIOS
    • Live CD
    • MultiBoot
    • Security
    • Virtualization
    • Web
    • Windows
  • InformatiWeb
  • Courses
  • IT
  • Learn to virtualize machines with VirtualBox
  • Manage VirtualBox and your VMs from a web browser
17 / 32
  • Control a VM remotely (via RDP / VRDP)
  • Manage VirtualBox and your VMs with HyperBox
  • Virtualization
  • 13 October 2018 at 09:53 UTC
  • Lionel
  • 1/2

Manage your VirtualBox 6.1 / 6.0 / 5.2 virtual machines from a web browser (phpvirtualbox)

Since VirtualBox is an open-source project and VirtualBox offers an API to communicate directly with its virtualization solution, some developers create programs and/or related scripts.
In this tutorial, we will show you how to manage your virtual machines from a web browser using the phpvirtualbox script originally created by Ian Moore, but which was later taken over by Smart Guide.

If you are looking for "phpvirtualbox" on Google, you will find :

  • the original project on Google Code (last update : 22/07/2013)
  • the project on SourceForge (the last available version was published on : 8/01/2016)
  • the current project on GitHub that has been very recently updated (the last update is from 2019)

In this tutorial, we will use :

  • the latest version available (5.2.0) of phpvirtualbox referenced on the "Releases · phpvirtualbox" page of the GitHub project.
  • version 5.2.8 of VirtualBox available on the official website of VirtualBox
  • a local web server to use this php script

Update :

  • for VirtualBox 6.0.0, you will have to download the "develop" version of phpVirtualBox from the official GitHub, as indicated on this page of the phpVirtualBox project.
  • for VirtualBox 6.1.0, you will also be able to use the "develop" version of phpVirtualBox which was updated in 2020, as indicated on the "Support for Virtualbox 6.1" page of the phpVirtualBox project.
  • as of October 2022, phpvirtualbox doesn't yet support VirtualBox 7.0
  1. Installing the web server for phpvirtualbox
  2. Installing and configuring phpvirtualbox
  3. Change password for phpvirtualbox
  4. Settings
  5. phpvirtualbox presentation

1. Installing the web server for phpvirtualbox

To install a local web server, refer to our tutorial about WAMP which is an easy solution to install a web server : Installing WAMP 2.2, 2.4 or 2.5 and its add-ons

2. Installing and configuring phpvirtualbox

As you can see on the official phpvirtualbox wiki, phpvirtualbox works through the "vboxwebsrv" process which is provided by default with VirtualBox.

To start this process, there are 2 possibilities.
Nevertheless, to begin, simply open a command prompt (cmd) and use the command below :

Batch

"%ProgramFiles%\Oracle\VirtualBox\vboxwebsrv.exe" -H 127.0.0.1 >nul

You will get a result like this :

Plain Text

Oracle VM VirtualBox web service Version 5.2.8
(C) 2007-2018 Oracle Corporation
All rights reserved.

Then, unzip the "phpvirtualbox-x.x-x" file downloaded from GitHub and unzip this file into a subfolder of the "www" folder (or "c:\wamp\www" in the case of WAMP).
Then, rename the "config.php-example" file to "config.php".

In this file, change these attributes :

  • $username : the username currently running the "vboxwebsrv.exe" process (hence the name of your Windows session)
  • $password : the password associated with the user above.
    Note that your Windows session must be password protected. Indeed, if you don't enter any password here (empty), an error will occur when you try to connect to the "phpvirtualbox" web interface.
  • $language : the language in which you want to use phpvirtualbox. In our case : fr

Note : the list of languages is available in the "languages" folder of phpvirtualbox.

In order for phpvirtualbox to communicate with the VirtualBox API, you must enable PHP's "php_soap.dll" extension.
To do this, open the "php.ini" file of PHP, and locate the "extension = php_soap.dll" line.

If not, you will see the error : PHP does not have the SOAP extension enabled.

For this change to be taken into account, don't forget to restart your web server (apache).
In the case of WAMP, you will have to restart the "wampapache" service.

3. Change password for phpvirtualbox

By default, login credentials for phpvirtualbox are : admin / admin.

Once logged in, go to : File -> Change Password.

Important : if the connection fails and the error returned by phpvirtualbox is "Error logging in to vboxwebsrv", make sure you have specified the credentials of your Windows session in the "config.php" file.
In addition, your Windows session must be password protected. Otherwise it will not work and this error will also show.

Enter the current password (by default : admin) and enter your new password.

The admin password has been changed.

Next page

Share this tutorial

Partager
Tweet

To see also

  • Hyper-V - Coexistence with VirtualBox or VMware Workstation

    Virtualization 8/30/2019

    Hyper-V - Coexistence with VirtualBox or VMware Workstation

  • VirtualBox - Clone a virtual machine (VM)

    Virtualization 8/25/2018

    VirtualBox - Clone a virtual machine (VM)

  • VirtualBox - Configure settings of your VMs

    Virtualization 7/22/2018

    VirtualBox - Configure settings of your VMs

  • VirtualBox - Connect an USB key to a VM

    Virtualization 11/6/2020

    VirtualBox - Connect an USB key to a VM

Comments

You must be logged in to post a comment

Share your opinion

Pinned content

  • Useful softwares
  • Our programs
  • Terms and conditions
  • Share your opinion

InformatiWeb Pro

  • Win. Server administration
  • Linux Administration
  • Virtualization

Contact

  • Guest book
  • Technical support
  • Contact

® InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.

Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.