Hi there,

I don’t often write something to my blog, mostly because I can’t find the time or the subject to write about, or the subject I can disclose to the public that is ^^. Anyway, I want to bust two bugs in one slap. That is writing something that is helpful to anyone interested and also for an archive of my projects. Often I start a personal project, mostly it doesn’t get completed because i get pulled of due other projects that actually bring food on the table. But this time I’m approaching it from another direction. Making my projects public for anyone to read. This keeps me motivated to complete the project and hopefully get some nice feedback from it.

My first project I’m posting is installing Xen 3.0.3 on a fresh server. Recently I’ve sold my webhosting company because I did not have the time, nor the long-term motivation for it. I’ve sold the company including the servers. But I managed to keep one server for myself and friends. This server is going to be used in this project so that I and my friends can have their own Virtual Machine.

Note that this is entirely new for me, and I don’t have any experience on virtualization what so ever, if you can provide me with any helpful feedback it will be appreciated :-)

Xen virtualization logoFor some reason I have chosen to use Xen, why I don’t know exactly, other then its open source and according to the manual very easy to setup. I did look into other possibilities but it seems Xen is the most complete, and free software for virtualization. Also build by some of the most experienced companies out there, that gives me a big boost in confidence on support, communities etc.

I will update this post frequently on the status of the installation, how I did it and a complete log of installation commands that worked for my server. So if this post intrigues you, bookmark it! :)

Project is finished. This website is now running on a Virtual Machine!

Update – April 28th

I’ve chosen to use CentOS 5 because I’m familiar to this operating system and it’s easy to use. I’m using this OS for my dom0 setup, and also for the clients (domU).

Update – April 28th – 20:00

Just got back from the datacenter, picked up the server I’m going to use for this project! After 2 years non-stop serving websites I thought let me clean the inside from dust, but surprisingly there was none.. at all..

Update – April 29th – 01:20

Attempted to install a clean CentOS 5 installation with the netinstall ISO, appears my dvd-rom is broken, replaced it with new one; The DVD itself is not OK, that was my last one.. Need to get to the store later. me 0 – 1 preparation.

Update – April 30th – 15:40

Today I configured the RAID, I’ve chosen for RAID10 with 4x 250GB hdd’s. This gives me 500GB disk space and a mirror for safety :-) Building the array obviously took a long time. Got new CD’s, burned the netinstall ISO and booted the installation thought a HTTP mirror, works like a charm. But there seems to be an error with the GRUB loader after installation, I tried to fix it for a couple of hours, google-d my ass off but can’t seem to fix the problem. Called in the help of a friend who happens to be an expert in my eyes. Waiting for him to arrive and hopefully he knows how to fix it.

Update – April 30th – 19:00

Problem turned out to be the RAID10 configuration, somehow CentOS doesn’t ‘take’ it. Also Ubuntu doesn’t like the RAID 10 configuration. Now i configured 2 times RAID1 for all 4 disks. Still gives me 500GB of storage, and mirrors. Installed CentOS 5.4 thought netinstall, now installing Xen.

– Well, installing Xen was pretty much easy. These are the steps i made:

I want to store all my VM’s on a big disk, for me that was the root disk. I created a folder on /data/vms/ for my virtual machines. After that I simply ran:

yum install kernel-xen xen

This installs Xen and the xen kernel. And it automatically adds the kernel to the Grub boot menu. You do have to make sure it’s set as default so it will boot that kernel on startup.

nano /boot/grub/menu.lst

Change the value of default to 0 (make sure the xen kernel is above other’s).

Reboot your system,

shutdown -r now

And it should boot from the new Xen kernel now!

To check if it is, run

[root@server ~]# uname -r
2.6.18-164.15.1.el5xen
[root@server ~]#

And we are done. We can setup virtual machines (domains) now.

That was pretty simple too, Xen comes with a tool that prompts you with the questions. You only have to enter the name and path basically for Xen to setup the VM. Type:

virt-install --prompt

When Xen ask’s for the Install URL you can use the images for your prevered flavor of linux, or what ever OS you want to install. I used CentOS for my first VM.

After installation, if you want to automatically boot your VM type on the domain-0:

ln -s /etc/xen/<vmname> /etc/xen/auto

For a list of Xen commands you can visit: http://xen-tools.org/software/xen-shell/commands.html

Update – April 30th 21:10

Well, it was a fast project for sure, all went easy as h*ll, except for the RAID10 issue. But everything is running smoothly and I have 3 VM’s running on the machine. Going to set it up in the datacenter again somewhere next week, And migrating this website to it! Thank you for reading, commenting is allowed :P And since it’s Queens Day here in Holland, im out partying now, bye!