Friday, October 19, 2007

HowTo Gentoo on Bytemark Xen host

Setting up a gentoo instance on a Bytemark xen system is simplified by the tools and image that Bytemark (www.bytemark.co.uk) have provided. There are a couple of catches however.

First thing to do is log into your Xen master and create your DomU:

xen-create-image --hostname=DomU_Hostname --ip=DomU_IP --dist=gentoo --passwd --boot


The installation will stop giving feedback for a few minutes. Be patient and the DomU will start to boot.

When the image boots you'll see your problem: the Gentoo init scripts will try to mount /proc and /sys, however these are already mounted by Xen.

Due to the problems you will not have been given the opportunity to set your root password, so you can't log in for maintenance. The solution is to add the following line to the xenmachine.cfg for your DomU:

extra = "init=/bin/sh"


Then boot the DomU and you'll be presented directly with a shell prompt. Now you can fix the /proc and /sys boot issue.

First remount the root as rw:

mount -o remount,rw /


Then edit /sbin/rc and comment out the code that mounts /proc and /sys.

When you've saved the file you need to shutdown gentoo and remove the "extra.." line you added to the xenmachine.cfg, then start your DomU again and it'll boot to the login prompt.