Friday, April 9, 2010

Virtual development environment: Part I

   In the first post I'll share my experience of using virtualization platforms in software development process.

    Why to use virtualization?
   I've started to work with several open source and custom projects at the same time. This forced me to think about optimizing my computer for more comfortable and fast work. And especially to get rid of the mess that I had on my local MySQL server: It had around 30 database schemas. And it was difficult to find one of them that I need for the project. Below are main issues that I was solving:
  • Work with several project simultaneously.
  • Explore multiple open source projects and compare different versions. I'm trying to keep track of new features that appear in every version of Pentaho BI Server, Jasper Server and BIRT.
  • Keep separate databases for every project. It helps to get rid of multiple schemas mess on the same database server.
  • Learning other operation systems, testing software in different envieronments.
   How to use virtualization?
   Initially I thought about virtual development environment as a separate virtual machine for every project. With a standard set of tools installed like: SVN, Java, Eclipse, Tomcat. But after trying to work with virualization platforms I have come to decision that it's better to virtualize only server part without GUI. 
   Now I open all GUI tools on my host machine. And virtual machines play the role of GUI-less servers. So typical virtual machine is running Linux, MySql and a Tomcat with web application.
  One reason is that you will tend to move all programs like browser and mail client either to the guest machine or to the host. Because it's not convenient to switch often back and forth for copy-pasting. It's easier to use a single machine where you have a Browser, Mail Client, Instant Messangers and IDE.
   Another reason is that almost all virtualization platforms don't allow to use graphics-accelerator card on guest machine. And when you run your favorite IDE on machine without graphics-accelerator it looks quite poor. And most probably you will not like working with it. Fonts are less clear and everything other looks less attractive. 

   Which virtual platform to choose?
   When choosing virtualization platform I have considered following options:
  • VMware(Player, Server, Worstation, ESXi)
  • VirtualPC
  • VirtualBox
  • Xen
  I've chosen VMware Server. Because it's free and widespread. One thing I like most about VMware Server is that it's running as a windows service, and you never see it neither on taskbar nor in system tray. My guest machines is configured to run after Windows is started. So they never catch my eye, however are always available via virtual network.
    Xen and VMware ESXi are more complicated to setup and use. And also I don't sure if they will help with graphics-accelerator issue. 

   The results. 
    Here is a final configuration that I use:

    Host machine
  • OS: Windows Vista Home Premium 64-bit. Windows was preinstalled on my notebook and I'm not yet ready to change it for Linux.
  • Software:  VMware Server 2.0.2
  • RAM Total: 4 Gb  
  • RAM used by Windows Vista: 2Gb. But I need to admit that Windows releases some of allocated memory when other applications require. Up to 500Mb I suppose.
   Guest machine:
  • OS: Ubuntu Server 9.10 32-bit.
  • Software: Java, SSH server, MySQL, Glassfish, Pentaho
  • RAM used by Ubuntu Server: less then 50 Mb.
  • RAM total used when Glassfish is in debug mode: up to 1 Gb - 1.2 Gb.
  • VMI support.
   Now I use only one always-running guest machine. But VMware Server is smart enough to allocate only as much RAM on host machine as guest's Ubuntu actually use. As a result I'm able to run 2-3 virtual machines on my host. Some of then with GUI. Ubuntu Desktop use about 150Mb.
   I have found my virtual development environment worth the time that I spend on it. However I still need to prove and check the advantages, because I'm working in this environment for only two month.
   In the next post I plan to share the issues and their solutions that I found while setting up virtual machines.

0 comments:

Post a Comment