Radu Cotescu's professional blog

g33k w17h pa45510n

Using VirtualBox for Virtualizing Servers

Oracle VirtualBoxA considerable amount of my diploma project runs on several virtual machines, due to the lack of multiple physical machines required for the job. Of course, Riker isn’t tailored for production regarding this project, but it was built specifically to allow me to develop the code without restrictions. For a load under 10 users I think it would do the job quite okay. You might be asking yourself what kind of project it is if an Intel Core i7 930 processor couldn’t handle the job. I’m not going to tell you… Yet.

Because of the way VMware Server works on the last kernels from Ubuntu this tool couldn’t have offered me the stability and performance I need. And because I really like to use my graphics card to decode HD content, Xen or VMware ESXi weren’t an option either. What was left? VirtualBox is made for desktop virtualization. Still, the ease of use of this product and the fact that it never ever failed for my needs made me actually consider it could be up for the job. Of course, the only problem I had was daemonizing it somehow so that I could run the virtual machines without necessarily being logged in. It actually crossed my mind a few times to write some scripts which would rely on the CLI tools that VirtualBox provides, but the lack of time always made me think twice before this.

At some point in time though, I discovered VBoxTool, which coincidentally is nothing more than a collection of wrapper scripts written in BASH which help you daemonize the hypervisor. How cool is that? Provided that you set up a configuration file and add an init script to the desired runlevels (all this by following proper written explanations directly from the author), this “facade framework” (design pattern pun intended) will automatically start/resume the desired virtual machines and will shutdown/suspend them together with your host. I had to modify about four lines of code to alter a bit the behaviour for shutdown so that my VMs would always get suspended instead of turned off, but that’s almost nothing.

The VMs that are on most of the time both run Ubuntu Server 10.04 64bit: one with 2 GB of RAM and Oracle 11G, the other with 128 MB hosting an internal repository under nginx (which is a very fast web server). They both work great and my host doesn’t at all feel sluggish. Actually all these three machines (host + 2 guests) run incredibly well. The maximum sustained throughput I achieved using the virtualized repository was 60 MB/s which is pretty impressive. I haven’t tried yet to test the DB engine with a consistent load (a great number of queries directed to it simultaneously) but I will get that chance near the end of June when I’ll perform some load testing on my application.

By the way, nine days ago VirtualBox 3.2 has been released (the first release of VB since Oracle acquired Sun) and a bunch of new features have seen daylight. Check it out.

Considering that there’s a reliable way of running virtualized servers into a daemonized VirtualBox, do you still want to puzzle yourself with VMware Server’s erratic behaviour?

Linux, VirtualBox, Virtualization

« OpenOffice.org 3, Ubuntu and Romanian fonts Oracle TopLink, the ORA-00900 error and stored procedures »