How to install PhpVirtualbox on Ubuntu 14.04 Server – LAMP

PhpVirtualbox is a Php web application where you can manage your virtual machines. it is a great application and similar to the normal desktop gui for virtualbox. so if you have installed Oracle Virtualbox on a headless server and you miss the gui you should definitely install phpvirtualbox.

To complete this guide you have to have ubuntu 14.04 LTS server – LAMP stack  and Oracle Virtualbox installed

Step 1. Install Oracle VirtualBox extension pack

So the first thing we should do is to install the extension pack for virtualbox. the extension pack will provide us with following functionalities.

  • The virtual USB 2.0 (EHCI) device
  • Host webcam passthrough
  • Intel PXE boot ROM
  • Experimental support for PCI passthrough on Linux hosts

it is important to use the same version as the VirtualBox. The latest version can be found here. to download the extension pack and install it, run the two commands in your terminal.

Step 2. Install PhpVirtualBox.

We have to install php-soap  module to get PhpVirtualBox to work.

And restart the server to get it recognize the new module.

Download the latest version of PhpVirtualBox here.

Now we need to extract the file we just downloaded.

If you don’t have unzip do a.

Move the extracted folder to  the apache DocumentRoot.

Step 3. Configure PhpVirtualBox.

We will have to edit PhpVirtualbox config.php file

Change the user name and password to that user there is running Virtualbox.

You should now create a file called VirtualBox.

You should add this line in the file.

Now you should start the vboxweb-service, and make it start automatically on boot

Step 4. Test PhpVirtualBox.

Everything should be installed and working by now. so go to you local_ip_or_domain/phpvirtualbox
it should look like this :
Username : admin
Password . admin
Remember to change your passwordand username

Virtualbox-login

 

Everything should be running now and it is ready to create your Virtual Machines

 

 

  • Johnny

    Ubuntu 14.04.1 LTS server amd64bit fresh install, open ssh installed,

    from your command build-essential it give me :
    reading package list: done, reading state : done
    build-essential is already the newest
    0upgrade, 0new, 0removed, 3 not upgraded

    So i’ve start again and follow up.
    for the source.list Vi into /etc/apt/sources.list

    at the key, i complete with oracle_vbox.asc, because it’s said: gpg – no file found
    and i remove the -o- , i wget the file and import it, with OK result.

    do the apt-get update and after, apt-get install virtualbox-4.3 -y
    full install done virtualbox as 4.3.20 96996

    module dkms : done , starting virtualbox module : done

    usermod -aG.., with my only user created at the install (name: virtual)
    Kernel module all loaded up fine.

    install the last extension and do VBoxManage, all OK 100%
    nano phpVirtualbox config.php : user virtual pw: virtual
    follow all the rest but still error.
    Perhaps related to a missing mysql or an extra php package.. So i install
    as you show the full LAMP-server package. But still, at login
    page : can’t connect to host.. with same message ?

    redo the build essential you ask, and same message..
    do vboxdrv status and said all 4 module loaded.

    After i setup a static ip in /etc/network/interface, still same.
    Maybe it’s related to a chmod or chown for access file.. but i don’t know more.

    For the site, perhaps over a forum or so. But it’s well done and easy to navigate, hope you will got a high rank in search result. hehe

    Thanks again, appreciated

    • Thant you.

      just to make sure. the user you entered is named virtual and you ubuntu 14.04 user is also virtual right ? i don’t have so much time right now but i can properly give you an answer tomorrow

      • Johnny

        Hi
        Yes, it’s also virtual. and pasword too. Or perhaps i should have made a different one, or just adduser in some place at the php install..

        • Yearh. i must admit i don’t know what is wrong here, Do you have a firewall enabled on the system ? er else if you want to i think i have pretty much spare time in the next week where i could help you over team viewer / skype if you want too. then we can try on a fresh install where you have installed lamp ;)

          • Johnny

            Hi thanks for the help. So i finally get into the web ui. adding var $consoleHost=myip.
            to the file : phpvirtualbox/config.php and do a full install with :
            apt-get install apache2-mpm-prefork apache2-utils apache2.2-bin apache2 apache2-doc apache2-suexec libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libapr1 php5-common php5-mysql php-pear wget

            So now i can created a Vm, but i can’t select an iso file. It give me permission acces error. pick from a mnt drive or other location..
            Maybe a chown command need to be made somewhere..?

          • i just don’t get it. if you have ubuntu 14.04 LTS – Lamp – VirtualBox installed and have been follwing the guides on the site it should just work out of the box ? it worked fine for me….

            And you are sure you have done :
            sudo usermod -aG vboxusers demo (inserr
            t your user name instead of demo)

          • hmmmm. i ran in to the same problem as you this morning, due to an failed upgrade of the system

            i ran these commands in the terminal

            # sudo dpkg –configure -a && sudo apt-get update && sudo apt-get dist-upgrade && sudo reboos

          • Johnny

            Hi
            Thanks for the line. Indeed, it help to fix thing and gain access to php without much problem. The one i still got is again a permission access when I try to select an iso file. Perhaps with permission or change the groupe permission to root… i don’T know.
            So far, i’ve install Mint17 with virtualbox on and work quite ok. Haven’t tested the php yet.

          • I tried to follow the tutorial this morning and i was having the same problem as u ! but i fund out there was a fail in the guide ! i missed a R in the path to

            sudo nano /etc/default/virtualbox

            So if you still want it to work i have updated the guide and it should work now. sorry for the time you have spend on all of this.

            But i would advise you to run a headless server ith virtualmachines because you will get more performance out of it