During my last post, I described the redirection of Linux Output to Serial on an Upstart Distribution based (using RHEL6). The main aim of this post is to describe the same on Systemd Distribution based (RHEL7). Before I begin with the technical matters, I have to say that I've been quite impressed by how Systemd makes this configuration so easy (no pain at all! So cool!). This isn't to make a comparison between Systemd and Traditional Init or Upstart, but you can check these two previous posts to draw your own Conclusions: VSP/Traditional Init, VSP/Upstart.
Let's now delve in the interesting matters. The whole procedure is just about setting Kernel Options and reboot, and if the reboot can't be performed right away, just start a systemd service.
1. Set the Kernel Options boot options:
On RHEL7 with Grub2, add "console=ttyS1" to GRUB_CMDLINE_LINUX in /etc/default/grub file (You might also remove rhgb quiet as rhgb is for RedHat Graphical Boot and quiet is meant to hide the majority of boot messages before rhgb starts)
Changes to /etc/default/grub require rebuilding the grub.cfg file. This file location's on BIOS based machine is /boot/grub2 and for UEFI based machine, it is /boot/efi/EFI/redhat/.
On BIOS Based Machine:
On UEFI Based Machine:
2. Reboot or start a serial-getty service on ttyS1
Now we can either reboot the System to have the Kernel Loaded with the new parameter during the reboot , or (especially if we can't afford a downtime :-)) run the following to have a getty service started right away on the ttyS1.
That's it! So simple! Go on the console, run vsp and there's a nice prompt...
Reference:
http://0pointer.de/blog/projects/serial-console.html
If you are wanting to login as root, don't forget to add "ttyS1" in /etc/securetty.
ReplyDeleteThat's a great advise!
DeleteFound two issues with this approach; on some hardware if a fast baud rate isn't specified, RHEL 7 hangs up waiting for the console and ends up printing an infinite loop of kernel crash messages. Just adding the serial console causes the video card console to be blank. To resolve these issues use:
ReplyDeleteconsole=tty0 console=ttyS1,115200
In our case we want the serial port to be the 'system' console; if one wants the opposite just swap them.
Thanks for that great feedback, you are totally right.
DeleteI'm rewriting that section to include your feedback.
Thanks again
ReplyDeleteThank you very much for your kind words.
123 HP Com
Thanks for the post! I have tested this on HPE Proliant Gen10 with CentOS 7.7 and it partially worked.
ReplyDeleteI opened SSH session to ILO5 and I was able to use TEXTCONS command to connect to console, but it still displays "Monitor is in graphics mode or an unsupported text mode." - and you can see nothing from SSH session.
BUT: at the same I had the ILO graphical console open and I saw, that everything that I typed in the SSH session was visible and executable on the ILO console... quite strange. Do you have any idea how to proceed to text only mode?
Hello,
DeleteThe error seems related to ILO itself, in any case, make sure that console=ttyS1 is well added, then try the following:
stty -F /dev/ttyS1 speed 9600
grub2-mkconfig -o /boot/grub2/grub.cfg (or if on UEFI: grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg )
systemctl start getty@ttyS1
Hi, In "HPE iLO 5 2.10 User Guide" I have found a chapter, that describe how to do it, very similar to your solution. Search "Configuring Red Hat Enterprise Linux 7 to use the iLO Virtual Serial Port". Not all commands possible and VSP can be used to connect and it works. Thanks for the help!
ReplyDeletehttp://itdoc.hitachi.co.jp/manuals/ha8000v/hard/Gen10/iLO/880740-007_en.pdf
You are welcome
Delete