Table of Contents
1 /etc/default/grub
Change /etc/default/grub as below.
- Change GRUB terminal to console and ttyS0. This will provide one GRUB to a monitor display and serial console.
- Change linux kernel console to tty1 and ttyS0. This setting will be taken over to userland, and there will be two login prompt for tty1 and ttyS0.
#!/bin/shsudo cp /etc/default/grub /etc/default/grub.origcat <<EOF | sudo tee /etc/default/grubGRUB_TIMEOUT=1GRUB_DISTRIBUTOR=GRUB_DEFAULT=savedGRUB_DISABLE_SUBMENU=trueGRUB_TERMINAL=”console serial”GRUB_CMDLINE_LINUX=”console=tty1 console=ttyS0,115200 loglevel=4″GRUB_CMDLINE_LINUX_DEFAULT=”resume=/dev/system/swap”GRUB_SERIAL_COMMAND=”serial –speed=115200 –unit=0 –word=8 –parity=no –stop=1″EOFsudo grub2-mkconfig -o /boot/grub2/grub.cfgsudo reboot
2 Execution result
GRUB to monitor display is as below.
GRUB to serial console is as below. This article used “sudo virsh console <vmname>” for connecting serial console.
Login prompt to monitor display is as below. tty1 is displayed with press Ctrl + Alt + F1.
Login prompt to serial console is as below.