Edit “/etc/sysconfig/grub”
Add to end of GRUB_CMD_LINELINUX, “console=ttyS0” Replace ttyS0 with your serial port.
Mine looks like this:
GRUB_TIMEOUT=5 GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet console=ttyS0" GRUB_DISABLE_RECOVERY="true"
Run the following commands as root: Again replace ttyS0 with your serial port
stty -F /dev/ttyS0 speed 9600 grub2-mkconfig -o /boot/grub2/grub.cfg systemctl start getty@ttyS0
Thanks! Quick and to the point. Much appreciated. I just need to set the speed in my bios and I am good to go!
Speed just prints the speed parameter. If you want to set it to something different, use ispeed:
stty -F /dev/ttyS1 ispeed 115200
Interesting. Looking at the manual, it looks like ispeed sets the input speed and ospeed sets the output speed. Thank you! https://linux.die.net/man/1/stty
Regarding the note “Replace ttyS0 with your serial port” — you may be wondering which serial port to use. Look in the BIOS settings to see which COM port is configured for remote access. COM1 corresponds to ttyS0, COM2 to ttyS1, and COM3 to ttyS2. I have seen different generations of Supermicro servers with different default COM ports. If you see serial output from the BIOS screens while the server is booting, but output stops as soon as Linux starts to boot, you probably have the wrong TTY in the kernel command line.
for KVM Centos 7/8 VM I usually add : console=tty0 console=ttyS0,115200