Creating Virtual Machines for multiple purposes.

Scenario: There are two servers in a local college that run Windows Server 2003 and Windows Server 2008 respectively. The only services they provide are Active Directory and File Sharing for approximately 40 people (essentially the staff of the college). The servers are underutilized and are typically running with less than 10% CPU consumption. The college wants to provide additional services to the staff but is not looking to purchase more hardware right now. So they would like to extract more from the existing setup.

Approach:Although there are many ways of approaching this problem on Windows, the local system administrator is not really well versed with them. These services are much easier to deploy in Linux . So the approach we are taking is to deploy a virtual machine (VM) which provides these services. We chose VirtualBox as the platform for the VM. The advantages of using virtual machines are twofold. First, once the VM is configured with a static IP (using the bridged adaptor functionality provided by VirtualBox), it will be indistinguishable from a physical machine for the rest of the computers and the users. More importantly, this arrangement allows the existing hardware to be used even though a completely new operating system has been added to the mix. As we shall see later, there is another important advantage to using a virtual machine.

Installation:To test our approach, we took a simple desktop running Mageia 2.0 and installed the VirtualBox binaries through drakrpm. We chose the server install of Ubuntu 12.10 as the Linux operating system (OS) since it comes with most of the necessary software packages for serving the college. We downloaded the iso for the server from Ubuntu . We started VirtualBox and followed the instructions for creating a virtual machine. The parameters we chose for the VM were as follows:

This should be enough for the expected load on the server for the next one year. As alluded to earlier, the advantage of going with the VM approach is that the VM could be configured to use more RAM and more CPU cores if and when load increases or when new hardware is purchased. After the VirtualBox VM configuration was complete, in the Settings menu, we increased the video RAM to 64MB and attached the ISO image to the CD ROM drive. Done!

Before we began the installation of Ubuntu, one question that arose in our minds was whether we could deploy the same VM on the second server but configured differently to support a groupware product like Kolab . So we quickly decided to first create a Ubuntu VM with a base install of the server and then clone this base VM as many times as needed. Thankfully, cloning support is built into VirtualBox. So we started the VM, booted off the ISO and installed Linux with only the SSH daemon. Once the installation was complete, we rebooted the Linux VM and patched it with updates using

sudo apt-get update && sudo apt-get upgrade

The base install was ready. We once again shut down the VM and quickly created two clones. We ensured that the check boxes for the MAC addresses to be re-initalized were ticked so that the NICs of the two VMs would have distinct MAC addresses. Otherwise ARP was going to go bonkers :-) We booted the first clone and installed git , LAMP as well as configured additional users that were expected to administer the system. The second clone was booted and checked to verify it was okay. The remaining configuration of the two servers is still underway. I shall report on that in another article.

This however gave me another idea. For a long time now, I have wanted to re-visit some old DOS games but of course they don't work in modern systems very well. Would a VM work? A little bit of googling and turned out that yes, someone had already made it work! So quick as a flash I created a VM with 500MB disk space which booted MS DOS 6.22 . Great. Copying files into the DOS VM is tricky on some systems. There is a clever trick that I used to copy over files from my host to the VM (essentially some hacked CONFIG.SYS and HIMEM.SYS files etc.). The trick uses the fact that DOS can recognize ISO 9660 format CDs. So if I could copy over my old DOS games ( Day of the Tentacle anyone?) onto a virtual CD (.iso), then I could load that virtual CD into the DOS VM. Turns out you can convert any arbitary directory into a ISO 9660 .iso file using a tool called mkisofs on Linux. I used mkisofs to create an iso file from the directories containing the utilities using the command

mkisofs -J -allow-leading-dots -R -V “Utils” -iso-level 4 -o ./configfiles.iso DOSFiles/

This created a file with the name configfiles.iso which was quickly mapped onto the CDROM drive of the VM through the VirtualBox menu. Voila! Instant access to the files on the host without requiring them to be first copied into the VM and then deleted once their use is done. That's it for now. I will get back to you after re-living some DOTT!