We have all used VirtualBox which is essentially a personal use virtualization software. We have typically used it on a Desktops, both windows and linux. Generally, on a Ubuntu 14.04 with Unity Desktop. about 1 GB to 1.5 GB of RAM is used up and with notorious compiz, the utilization increases without explanation sometimes. Below one can find a simple way to install Oracle VirtualBox on a Ubuntu 14.04 server without GUI as an Ubuntu server when fully installed uses about 250 MB of memory which easily gives you about 1.2 GB additional RAM which you can give to other demanding VMs. You can access the Virtualbox interface using a browser of your choice and carryout all operations as you do with a standard virtualbox installation on a desktop.
Below are steps that you need to follow sequentially. For obvious steps and dependencies, there is no explanation. Wherever required, explanation is provided
- Install Ubuntu 14.04.01 LTS – 64 bit. I am assuming your CPU has more than 4 GB RAM and you will install many VMs in the VirtualBox for testing
- sudo apt update && sudo apt upgrade -y
- sudo apt install build-essential dkms unzip -y
- Add Virtualbox Repository & repository certificate
- sudo nano /etc/apt/sources.list
- add the repository at the end of the file: deb http://download.virtualbox.org/virtualbox/debian trusty contrib
- Save the file and exit ( Cntl O & Cntl X)
- add the certificate : wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add –
- sudo apt update
- Update and install Virtualbox along with the dependencies
- sudo apt install virtualbox-4.3 -y
- This will download a good 100 MB to 110 MB worth files and dependencies
- Add the system user in the vboxusers group. Virtualbox can be accessed by users who are part of the vboxusers group. vboxusers group is created when VirtualBox is installed on the server. You do not have to create vboxusers group.
- testuser is a system user which I have used to log into the server using ssh
- sudo usermod -aG vboxusers testuser
- Check the status :
- sudo /etc/init.d/vboxdrv status. It should show this output on the screen……………………..VirtualBox kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) are loaded.
- if above output is not seen, run: sudo /etc/init.d/vboxdrv setup
- Download & Install VirtualBox extension Pack
- wget http://download.virtualbox.org/virtualbox/4.3.12/Oracle_VM_VirtualBox_Extension_Pack-4.3.12-93733.vbox-extpack
- sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.12-93733.vbox-extpack
- Download & Install phpvirtualbox along with apache & php5 and php-soap
- sudo apt install apache2 php5 php-soap
- wget http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.3-1.zip
- unzip phpvirtualbox-4.3-1.zip
- sudo mv phpvirtualbox-4.3-1 /var/www/html/phpvirtualbox
- sudo cp /var/www/html/phpvirtualbox/config.php-example /var/www/html/phpvirtualbox/config.php
- sudo nano /var/www/html/phpvirtualbox/config.php
- Replace the vbox user with
var $username = ‘testuser’;
var $password = ‘test’;
- Save & Exit
- Create a new file as below in step 1 and add the line as in step 2 replacing testuser with whatever you are using
- sudo nano /etc/default/virtualbox
- Save & Exit
- sudo /etc/init.d/vboxweb-service start
- Accessing Virtual box from another machine
- Open a browser and navigate to http://<ip-address>/phpvirtualbox.
- Default user id is ‘admin’ and password is ‘admin’ (both without quotes)
- Complete and enjoy your installation. If you are using Chromium and having issues with Flash while connecting to the console on the right, I suggest you use Firifox or fix the flash issue with Chromium
If you got this to work and you liked this post, please appreciate by clicking on the Like button below.
For Ubuntu 16.04 need to do the additional stuff
sudo apt-get install libapache2-mod-php php-xml php
In ubuntu 16.04, php5 is no linger installed. It is by default php 7. As usual …cutting edge and the latest. Why keep using old stuff 🙂
Enjoy your Virtualbox and php installation.