Compiling a domU kernel

From PrgmrWiki
  1. Get a kernel from kernel.org. We used http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.2.tar.bz2
  1. While you're waiting, get build dependencies. On CentOS:
yum install gcc
yum install ncurses-devel
  1. Configure the kernel. I started with:
make allnoconfig

Then I went on to enable very few things. (This isn't an exhaustive list. Make sure you get the block and net devices.)

CONFIG_PARAVIRT_GUEST=y
CONFIG_XEN=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_PARAVIRT_CLOCK=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_HVC_DRIVER=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y

Created a domU config file:

kernel = '/boot/vmlinuz-2.6.32.2-xenU'
vif = ['ip=192.168.70']
disk = ['file:/mnt/slackware.13-0.x86-64.img,xvda1,w']
root = '/dev/xvda1 ro'
extra = 'console=hvc0'

Make sure that the domU is set up to create a getty on /dev/xvc0