I am looking for the step by step instructions to setup at least two simple Ubuntu Virtual Core 12.10 Server VMs on Oracle VirtualBox under Windows 7 64bit.

The test setup would be:

  1. Apache HTTP server on the Windows host acting as a Load Balancer. The result will be that going to http://localhost:8080 would balance between two nodes and providee session replication.

  2. Two lean, small footprint, Ubuntu Server guest nodes with Java 7 and Tomcat 7.

The intention is to help everyone doing High Availability / Load Balancing development and testing to create a reasonable environment on the local workstation or mainstream notebook in as little time as possible.

  • Have you done any research yourself? Or are you just asking here in the hope that someone can do all the work for you? Oct 22, 2012 at 9:48
  • 1
    I just got it all running 8 hours ago. There are many bits and pieces around the interned, but not a single site provides a half-way comprehensive answer. Partially I was thinking of answering it myself and looking for comments / improvement suggestions.
    – Alex Pakka
    Oct 22, 2012 at 12:11
  • 1
    This question received over 1k views. While I don't dispute moderators' decision to close it, I would be willing to improve both, the question and the answer... E.g. I could specify more details about the required setup to avoid any arguments about flavours.
    – Alex Pakka
    Feb 22, 2013 at 18:55

1 Answer 1


Following assumes you did use Tomcat before, and simply want to create your own test environment.

Pre-requisits: As this is a 64bit setup, ensure your host supports CPU hardware virtualization. Many notebooks do not support it out of the box, but vendors typically provide BIOS upgrade, sometimes with warranty implications, that enables virtualization. Alternatively, use 32bit guests.

Step 1 Download ubuntu-12.10-server-amd64.iso (this one has worked for me, feel free to try other flavours, the instructions are not very specific to this build).

Step 2 Open Oracle VM VirtualBox manager and create a New Machine with the following profile:

Operating System: Linux

Version: Ubuntu (64bit)

Base memory: 512 MB Processors: 1 CPU Display: leave default

Storage: Remove SATA and add SCSI controller, Lsilogic. Add VDI HDD of at least 2GB in size (512 MB of it will be used for swap, actual OS and software will use about 1.1GB). I recommend 4GB with Dynamically Allocated Storage option to have some room for tests. Also add IDE controller and attach your Ubuntu Server .iso as a CD drive The reason behind SCSI is that we will use Virtual Core of Ubuntu and it does not have SATA drivers out of the box.

Audio: Disable it

Network: You can choose Bridged Adapter for startes, you will switch to Host-only Adapter later on. Alternatively, create two NICs, with NAT and Host-only adapter (see Step 4)

Make sure the order of devices in your machine setup has HDD first for later on.

Step 3 Start up your machine. Right after selecting language for the setup, hit F4 to select core before starting the actual installation. Choose "Install minimal virtual machine" (more on it here: https://askubuntu.com/questions/57336/minimal-system-or-minimal-virtual-machine-on-install) Follow the setup process using defaults, use up entire disk for your partition etc., until you hit the section "Software Selection"; mark Tomcat Java server there. Keep going through GRUP install and login as user you created. All in all it should take about 15-20 minutes. After it is running from HDD, you already have your Tomcat started!


  • On your host system, open a browser and go to http://[guest host name]:8080; if your were going with default host name, it would be http://ubuntu:8080 - you will see your Tomcat start page with all the paths where you can configure and put your code. If it does not resolve, run ifconfig on your guest and use the IP address.
    • Your webapps are under /var/lib/tomcat7/webapps/
    • Your tomcat7 server.xml is under /etc/tomcat7
    • Logs are under /var/log/tomcat7

If you are not a vim professional and have experience with various commanders I recommend to, sudo apt-get install mc to be able to start Midnight Commander via mc.

Power down your new machine via e.g. sudo shutdown -P 0.

Step 4 Cloning of the VM. When you clone it to create another guest, make sure that your MAC address on the NIC stays the same, there is a small problem with NIC autodetection. So, to clone: a) create a clone b) change MAC address of the NIC c) start up the second machine (it will take 2 minute delay as network layer will complain) d) change /etc/udev/rules.d/70-persistent-net.rules so that ATTR{address}== matches the MAC address of the NIC in VirtualBox settings. Done.

Step 5 Setting up the network.

  • In VM Manager File | Preferences ensure you have VirtualBox Host-Only Ethernet Adapter and that the DHCP is on and set up.
  • Switch your Ubuntu guests settings on eth0 to VirtualBox Host-Only Ethernet Adapter. Check that MAC addresses are different among them, but do not change from what you had in 70-persistent-net.rules
  • Start both VMs up, they should get two different local addresses. If you bridge your main LAN adapter and your Virual one in Windows, you will be able to use their IPs to access the web sites.

Step 6 Setting up Apache HTTP. Follow, e.g. these instructions http://satishkumars.wordpress.com/2012/03/07/how-to-load-balance-tomcat-7-with-apache-2-2/

Step 7 Configuring actual Tomcat cluster: http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html

Useful tools: - If you are tried of sudo-ing every time, do sudo su - to work as root, as you probably do not care much about the security on these virtual machines - lshw -class network gives you a nice overview on your NIC adapters - ifdown eth0 then ifup eth0 allow you to renew network settings without restart

  • Please, note, this question was asked 4 years ago. If you quickly need a Tomcat cluster for local development and testing, you are better off with Docker running Tomcats and Nginx. There are plenty of online tutorials that will get you from zero to a running cluster in less than an hour.
    – Alex Pakka
    Sep 27, 2016 at 19:15

Not the answer you're looking for? Browse other questions tagged .