This site is now 100% read-only, and retired.

XML logo

xen etch to lenny upgrade serial console
Posted by dkg on Sun 13 Sep 2009 at 23:33
I maintain several xen machines. Most servers that i maintain use serial consoles (i should probably write another post in more detail about why serial consoles are the One True Way to manage a server).

Trouble is, the way that xen works with the serial console has changed between etch and lenny. So what's changed? From what i can tell:

  • The way that the dom0 Linux kernel interacts with the hypervisor's console has changed between Linux 2.6.18 (etch) and 2.6.26 (lenny), and
  • the Xen hypervisor's method of specifying the console itself has changed between Xen 3.0.3 (etch) and 3.2.1 (lenny)
In etch systems, i had a standard GRUB specification like this (as noted earlier):
title           Xen 3.0.3-1-i386-pae / Debian GNU/Linux, kernel 2.6.18-4-xen-686
root            (hd0,0)
kernel          /xen-3.0.3-1-i386-pae.gz dom0_mem=131072 com1=115200,8n1
module          /vmlinuz-2.6.18-4-xen-686 root=/dev/mapper/vg_monkey0-dom0 ro console=ttyS0,115200n8 
module          /initrd.img-2.6.18-4-xen-686
savedefault
but in lenny, i find it necessary to do this:
title           Xen 3.2-1-i386 / Debian GNU/Linux, kernel 2.6.26-2-xen-686
root            (hd0,0)
kernel          /xen-3.2-1-i386.gz dom0_mem=131072 com1=115200,8n1 console=com1
module          /vmlinuz-2.6.26-2-xen-686 root=/dev/mapper/vg_monkey0-dom0 ro console=hvc0
module          /initrd.img-2.6.26-2-xen-686
In particular, the hypervisor itself needs an additional console=com1 argument to make sure that it uses the serial console (i suppose the com1=... argument simply specifies how to use the serial console should you need it, instead of a requirement to use the console).

And the Linux kernel itself for the dom0 needs to adopt hvc0 as its console, which i believe is an acronym for something like the "hypervisor virtual console" -- this way, the dom0 kernel will come out multiplexed over the hypervisor's console, no matter where that hypervisor's console is directed (you might not even need to specify this explicitly -- it might be set up by default).

When i tried to use the etch settings for the console with the lenny hypervisor and kernel, i saw the hypervisor try to come out on the video card, and a dom0 crash!

 

Comments on this Entry

Re: xen etch to lenny upgrade serial console
Posted by jamiemcc (74.65.xx.xx) on Mon 14 Sep 2009 at 15:26

I think you will also need to add:

extra = "console=hvc0"

To the xen virtual hosts' configuration file(s).

And - in the xen virtual host, you need to edit /etc/inittab:

-1:2345:respawn:/sbin/getty 38400 tty1
+1:2345:respawn:/sbin/getty 38400 hvc0
jamie

[ Parent ]

Re: xen etch to lenny upgrade serial console
Posted by dkg (64.105.xx.xx) on Tue 15 Sep 2009 at 03:49
[ View Weblogs ]
thanks for the additional info!

when you say "xen virtual host", do you mean the dom0 or a domU?

and when you say "configuration file(s)", do you mean /etc/xen/xyzzy for the domU named xyzzy or some other configuration file?

[ Parent ]

Re: xen etch to lenny upgrade serial console
Posted by jamiemcc (69.112.xx.xx) on Tue 15 Sep 2009 at 14:01

Gah - not very clear the first time.

Here's a take two:

I think you'll need to add:

extra = "console=hvc0"

To each domU's configuration file (in /etc/xen/host-name on the dom0).

And - in the domUs' file systems, you need to edit /etc/inittab:

-1:2345:respawn:/sbin/getty 38400 tty1
+1:2345:respawn:/sbin/getty 38400 hvc0
jamie

[ Parent ]

one true way
Posted by Anonymous (132.206.xx.xx) on Wed 16 Sep 2009 at 03:35
i would read your "why serial consoles are the One True Way to manage a server" post. let me know if you write it.
http://www.cs.mcgill.ca/~james/code/

[ Parent ]