Xen/Troubleshooting

It can be difficult to see what's going on as the system boots. The easiest way is to use another computer connected via the serial port. Another option is to use GNU screen.

Compile support for a serial console into your Xen kernel:

Add something like the following to your grub.conf:

The noreboot option tells Xen not to allow the kernel to reboot, even if you do. The hypervisor option com1=9600,8n1 and the kernel option console=ttyS0 tell both to output boot messages to the serial port.

Xen says Linux dom0 is not a Xen-compatible Elf image
Verify that you have a xen_guest section in the resulting dom0 vmlinux.

Required Modules
On AMD64 I found that it was necessary to add 'loop' and 'tun' to modules.autoload.d or Xen/HVM networking would not work at all. Do this by manually adding these to (or compile them into the kernel static instead of as modules)

Compiling Xen fails on kernel.c
If you have problems compiling xen (kernel.c fails to compile), try removing 387 support from your make.conf i.e remove 387 from the -mfpmath=sse,387 flag. invalid option `no-tls-direct-seg-refs'

If GCC does not know the 'no-tls-direct-seg-refs' flag (cc1: error: invalid option `no-tls-direct-seg-refs'), you will need to upgrade to a newer version (3.4 works) as described in the Gentoo GCC Upgrading Guide

gcc & '-fno-stack-protector-all' error
Xen 3.0.2 has some problems with USE Flag. If you get error of gcc because of '-fno-stack-protector-all' option try remove hardended flag.

Warning about /lib/tls on boot
If on booting the system you see a warning similar to the following, it means you're not using a recent enough version of glibc (you need to be using atleast version 2.4). This should be fixed by upgrading your system by following the Gentoo Upgrading Guide. Xen /lib/tls Warning

System Freezing on Reboot
If you experience your system freezing when rebooting, this could be due to conflicts between the Xen and gentoo network setups. To solve the problem, edit /etc/conf.d/rc and change the RC_NET_STRICT_CHECKING setting to 'lo'.

For possible further information, see the Gentoo forum thread

log flood when using dhcpcd-3.0.16 or 17
When using dhcpcd-3.0.16 or 17 as DHCP client for domU, you might notice your messages log being flooded. Also the messages log on the dhcp server will be flooded with messages every three seconds. Typical messages are: dhcp client

dhcp server

It can be solved by on domU

--Jhendrix 20:10, 27 June 2007 (UTC)

Host (dom0) networking fails to start
The default Xen networking scripts are not particularly resilient to differing network configurations. A number of solutions were discussed on the forums (http://forums.gentoo.org/viewtopic-t-646301.html and http://forums.gentoo.org/viewtopic-p-4799819.html#479981). Manual configuration may often be completed (as picked from preceding links) with the commands similar to the following after the Xen daemon has started (mileage may vary):

This may be hacked into startup via, or alternatively, via the "more Gentoo configuration" detailed in the next section.

Dom0 network configuration (alternative solution)
A cleaner solution for the network in dom0. This approach uses the standard gentoo networking scripts.

First, configure networking in /etc/conf.d/net as usual: /etc/conf.d/net

Once all the configurations are in place link into '/etc/init.d' as normal via the following command:

but DO NOT add the interfaces to startup via 'rc-update'. Instead, allow 'xend' to start the bridge interfaces via the following.

Move the original XEN networking script out of harms way:

and put this script in it's place /etc/xen/scripts/network-bridge

or grab a copy as follows:

Reboot and interfaces should come up as expected. One difference to note, compared to the original 'network-bridge' script is that this does not rename the interfaces and so 'eth0' continues to be the physical interface.