Running Virtual Machines on Linux

Virtualisation used to be a fairly hot tech buzzword but seems to have dropped off these days. Wikipedia describes it as “… the act of creating a virtual (rather than actual) version of something, including virtual computer hardware platforms, storage devices, and computer network resources.”

Running a virtual machine ( VM ) is surprisingly useful for a number of tasks. I use it mainly when I don’t want to install a load of extra software on my desktop machine simply to try something out. Fortunately running VM is quite easy these days and this blog post describes how I go about it. Although I use Linux most of the instructions below will probably work under Windows or Mac OS with few changes.

The main driver for this post was to be able to develop the HTML/Javascript for my Demo Site. I had been loading the site locally from my hard disk but some elements, e.g. the progressive loading for the 3DHOP library would only work from a web server. I didn’t really want to clog up my desktop machine permanently with a web server so a virtual machine was the way to go.

There are three main steps:

  • Installing a virtualisation environment
  • Obtaining and configuring a VM
  • Running software on the VM

Installing a virtualisation environment

Back in the days when I did software project management for a living we used a lot of VMware products for our virtualisation. This is more of an enterprise level product and is very much “paid for”. There is a “free as in beer” product for personal, non-commercial use called VMware Player which I have also used in the past and is very good. However there is a FOSS alternative, licenced under the GPL V2, called VirtualBox and, having heard good reports about it, decided to give it a go.

The version in the Ubuntu software repository is 5.0.40 but the latest version listed on the VirtualBox site is 5.2.4. As my application wasn’t really very heavy I decided to go down the quick route and installed from the Ubuntu repository. However there seems to be some good features in the later version so I should really update it at some point.

When the application is run then a window as shown on the right is displayed with a list of currently installed virtual machines.

Obtaining and configuring a VM

The OS running in the virtual machine is identical to that running on “real” hardware. So it’s possible to create a VM by just downloading a distribution and “installing” it in VirtualBox. However VMs are usually used to simulate servers which are normally command line based without window managers whereas most distros will include a window manager. Also a general purpose distro is not the best thing to simulate a web server because it needs specific software installed which is not always found in a desktop based OS.

The alternative is to use a pre-packaged installation specifically designed for use in a VM. There are a number of repositories of these installations but one that I’ve had success with in the past is Turnkey Linux. The site has a number of downloadable VMs designed for specific purposes, e.g. web servers, content management etc. Because I just wanted to debug some HTML and Javascript then I picked a basic LAMP install with Apache, MySQL, and PHP/Python/Perl.

Note that there are a number of formats available for download. Here we need the “Streamable OVA image compatible with VMWare & VirtualBox” version.

To install the downloaded VM then select File > Import Appliance from within VirtualBox and open the newly downloaded file. I use the defaults for the install but there are ( inevitably ) lots of different settings that can be changed – right click on the relevant VM in the list and select “Settings”.

Once it’s imported then I usually change the network adapter to be “Bridged Adapter” because this is the only setting that seems to work correctly for me. Also select the correct adapter – ethernet or Wi-Fi. Finally highlight the VM in the list on the left hand side and click “start”. A new window will open and the selected VM will boot. For the first boot only a number of passwords will need to be set and eventually you’ll end up with the server running and a screen with some useful details as shown on the left.

At this point it’s probably wise to run the usual software update commands to make sure that the OS has all the latest patches and fixes.

Running software on the VM

Copying the software to be tested over to the VM can be done in a number of ways. I use secure FTP ( SFTP ) and I use the FileZilla client. There are numerous clients available but FileZilla is FOSS and I used it for many years under Windows and I didn’t find anything better. It’s reasonably clever when copying because you can ask it to only overwrite if the source file is newer than the destination. This way you avoid copying everything over when updating the software. The alternative is to do something clever with rsync but I’ve never needed to go that far.

The root directory for the web server is at /var/www and I put my demo site in a subdirectory as the root area contains some useful web management tools that I didn’t want to delete. When everything’s copied over then pointing the web browser at the relevant address should bring up the page as shown on the left.


  1. This post has covered the installation of a Linux based VM. However it’s entirely possible to run a Windows based VM, assuming that a suitable licence is available. In the past I’ve used this approach when I needed to test browser compatibility across a number of different Windows versions ( XP, Vista, 7 etc. ) and it worked very well.
  2. Using a VM is probably the easiest way to get a clean OS to test installers and software dependencies.


Posted in FOSS | Leave a comment

Black and White Photographs

In today’s 4K, HD, virtual reality, multi-technicolour world the humble black and white image can still make an impact.

This is Bredon Hill in Gloucestershire. It was a very grey, non-descript sort of day but I was taken by this single tree and its proximity to the track at the top of the hill. Given how windy it is there I’m amazed that the tree’s grown that tall although the weather seems to have taken its toll on the branches over the years. Some more interest in the clouds would have been nice but you can’t have everything.

This is a panorama taken on a cross country skiing holiday in Austria. The colour version was OK but the black and white version emphasised the tones of the image a bit better.

This was also taken in Austria just behind the house that we were staying in. It was early evening, the daylight was nearly all gone and I liked the way that the trees became silhouettes against the sky. I was hoping for a little more interest in the clouds but that’s the best I could do even with a lot of post-processing.

This is a ruined tower, part of the Ch√Ęteau at Hierges. For once the sky had an interesting pattern to it which I think contrasted nicely with the patterns in the stone and the brickwork. Again the monochrome image emphasises the patterns in the scene.

Posted in Photography | 4 Comments