Apr 11

Hosters offer high-performance dedicated root servers for eligible monthly rates – at least some major Germany based hosters do so. Quad-core Intel i7 systems with 8 GB RAM for 50 EUR per month serve as a perfect start into server virtualization. And so it’s time to start your own virtual server farm.

First, you should prepare your host, of course. It’s best to run a long-term supported enterprise Linux distribution there, such as CentOS 5 supported until 2014 … Next you’ll need to find virtualization solution matching best your individual requirements. Spotting at performance, stability and security, there is at least a triple choice: VirtualBox, Xen or OpenVZ … and they all come for free. Of course there are more solutions like KVM, but on demanding stability and optimum security I’d rather remove Xen from that triple instead of adding KVM. It’s hard to always find up-to-date information on code quality in either project, but VirtualBox and OpenVZ gain strong commercial support and thus I’d focus on these.

VirtualBox is a user-space application with slight integration into host’s running kernel for network bridging and similar. It is emulating custom hardware and working with image files simulating hard drives. This all results in quite a lot overhead. In opposition to that OpenVZ replaces host’s kernel and thus more tightly integrates with host system. It’s not emulating any custom hardware, but providing limited access on existing hardware. Finally, instead of using images to simulate hard drives, OpenVZ works with folders in host’s filesystem managed as a chroot environment. All that results in very little overhead outperforming Virtualbox as well as Xen (according to several studies you might find on Google).

OpenVZ

Supported by Parallels this is the basis for that one’s Virtuozzo run by several major hosters. Installing it in CentOS 5 is working straight-forward according to this guide. After restarting your host into OpenVZ kernel and installing vzctl and vzquota tools, you need a template for your guest systems.

I still consider Gentoo Linux coming with a lot of advantages over other distributions. Though there are some existing Gentoo OS templates linked in OpenVZ Wiki it’s best to create your own using uptodate stage3 and portage snapshots. All you need is to follow another guide found here. I recently adjusted it according to my own experiences now resulting in a running Gentoo-based OpenVZ virtual environment.
However, you may skip that tutorial and use the resulting template provided here:

Gentoo 10.1 amd64
OS template for OpenVZ
~201 MiB, created on 2010-04-11
provided as-is without any warranty

You still need to install OpenVZ kernel and tools vzctl and vzquota on your host. After that put the linked archive in folder /vz/template/cache and keep it compressed there! Then you can create containers using this template resulting in booting a vanilla Gentoo installation. This way it takes only seconds to start another instance of a Gentoo-based server …

One Response to “Virtualization of Gentoo using OpenVZ”

  1. [...] Virtualization of Gentoo using OpenVZ Apr 11 [...]

preload preload preload