Add serial console to Xen hvm DOMU using grub2

Xen has a built in console when creating paravirtualized DOMU's, but this does not extend to hardware virtualized ones. In this case, we need to modify the configuration file, then set the DOM0 up to send messages and allow logins from the serial console.


This is basically like setting up a computer with a serial console and connecting to it via a serial cable.


  • in configuration file for DOMU (on DOM0), add the line:
    • serial='pty'
  • In DOMU
    • edit /etc/inittab and find line which starts with co:2345 and
      • comment any line that looks like ??:2345 by adding a pound sign in front (#)
      • Find the line which say
        sT0:23:respawn:/sbin/getty -L ttyS0 38400 vt100
        and uncomment it by removing the pound sign in front of it
      • To make the changes immediate, without rebooting the server, enter the command
        init q # or kill -HUP 1
        to tell init to reload. At this point, you should be able to execute the command xm console domainname from the DOM0
    • edit /etc/default/grub. At the bottom of the file, add the following three lines
      GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,38400n8"
      GRUB_SERIAL_COMMAND="serial --speed=38400 --unit=0 --word=8 --parity=no --stop=1"
    • Execute command grub-mkconfig > /boot/grub/grub.cfg
  • reboot DOMU and you should be able to access console via xm console. NOTE: this is a very basic console, so don't expect pretty
Last update:
2015-02-15 08:57
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.