• Home
  • Blog
  • Serial console support in Grub2

Serial console support in Grub2

Vincent Danen

August 16, 2015

This is another one of those "just so I don't forget" posts. I'm working towards migrating from IPA in a KVM-based virtual machine running CentOS 6 to one running CentOS 7 and the way of making serial consoles work in 7 is different than it was in 6 because CentOS 7 (and thus RHEL7) use Grub2.

Instead of editing /boot/grub.cfg, you need to edit /etc/defaults/grub and add:

GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"

The above will enable Grub output to the serial console. Next, change the GRUB_CMDLINE_LINUX command to the following so you can use "virsh console" to connect to the guest:

GRUB_CMDLINE_LINUX="rhgb quiet console=tty0 console=ttyS0,115200"

Once you have saved the file, you need to recreate the grub.cfg file with grub2-mkconfig:

# grub2-mkconfig -o /boot/grub2/grub.cfg

Now, reboot the system and you should be able to use "virsh console [VMNAME]" to have a serial console to the guest.

Leave a Comment

Comments use MarkDown. Need help? MarkDown Cheatsheet