251
We recommend that you refer to the corresponding server manuals before
applying the above settings.
If the baud rate is configured improperly, garbage characters may be
displayed during login.
The main console for system output is the last console listed in the kernel
parameters.
In the above example, the VGA console tty0 is primary, while the serial console
ttyS0 is secondary. It means that the serial console, as the auxiliary console, will
not receive the messages from init scripts, but boot messages and critical
warnings. If you need to see the messages from init scripts on the serial console,
change the order of the console parameters.
console=tty0 console=ttyS0, 115200
# vim /etc/securetty
Add ttyS0 to the command line at the end of the file. (In RHEL 7, ttyS0 is configured
by default.)
# reboot
Connect to the serial port via another computer terminal and configure a tool such
as SecureCRT to view the serial port output.
Serial port configuration in RHEL 7
1. Modify the grub parameters.
# vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --
parity=no --stop=1"
Supplementary information: Ensure that the command lines shown above
only appear once in the /etc/default/grub file. If any one of the command
lines already exists in the file, you only need to modify it rather than add a
same line. To be specific, only one GRUB_CMDLINE_LINUX_DEFAULT command
can exist in the file.
2. Make a backup and regenerate the grub file.
On BIOS-based server:
# grub2-mkconfig -o /boot/grub2/grub.cfg
On UEFI-based server: