Enable Serial/SOL Output in GNU/Linux Systems
When system boot to grub menu, press e to edit boot options, in the line starting with
linux ($root)/vmlinuz-, append
console=ttyS0,115200n8 console=tty0 to the end. Then press Ctrl + x to continue to boot.
Below steps were tested in RHEL 8.2 and 9.0.
- Enter directory /etc/default and make a backup of file grub.
sudo cp grub grub.bak
- Edit file /etc/default/grub, in line starting with
console=ttyS0,115200n8 console=tty0within the quotation marks.
- Execute below commands:
sudo grub2-editenv - unset kernelopts$
sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
If Something Is Wrong...
In case that something was did mistakenly in above procedure and the system cannot boot, you can try to boot into single user mode and restore the file grub from grub.bak created in first step, and then redo step 3.