Install VirtualBox on an Ubuntu/Debian server


This article is second from a serie about multiple dedicated web servers in virtual machines setup. I used this procedure to install Virtualbox on a Ubuntu 12.04LTS server.

The mail goal is to have a physical server containing one or more virtual machines, as well as a web administration interface (based on phpvirtualbox), accessible on https (instead of http) for security reasons.

An absolute pre-requesite is that the Linux kernel must be compiled with activated modules. It’s not always the case with some hardware providers (such as OVH for instance). In that case, the kernel must be re-compiled, which is explained in my previous post.

Virtualbox Install

This is how one must compile virtualbox (version 4.2.4) as well as the VM extensions. (mainly taken from the docs)

Phpvirtualbox install

Second step is about installing phpvirtualbox :

The configuring phpvbox : To do that, you must rename the /home/vbox/phpvbox/config.php-example file in config.php, then change the variable $password with the ‘vbox’ user password.

Then, create the /etc/default/virtualbox file with the following line :

And run the service with :

Apache Configuration

Apache must now be configured to access the administration interface via https.

Create a vbox file in /etc/apache2/sites-available with the following content :

Line 2 can be uncommented if you want to precise the domain name which will be used to access the interface (usefull if other web site will use https on the same server)

The default certificates can also be changed (line 6-7) with yours.

At last, the site can be enabled, and Apache must be restarted :

And that’s it :

(On first time, you may connect with admin/admin account. Of course, be sure to change this default password on first connexion in File/Change Password menu)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Crocoware technical blog