Modify CentOS 7 boot image to get output on Serial Console By default, the boot ISO of RHEL 7/CentOS 7 will redirect its output to Graphical Console, so that needs to be modified to have Output directed to the Serial Console (VSP). Mount the CentOS ISO on my elected Installation System (stivinstall ) root@stivinstall # mount -o loop /mnt/CentOS-7-x8664-DVD-1503-01.iso /var/www/html/mediacentos7u1/ mount: /dev/loop0 is write-protected, mounting read-only The main directory we'll be modifying in this ISO is Isolinux, so Copy this directory under a temporarily writable directory. root@stivinstall # cd /var/www/html/mediacentos7u1/ root@stivinstall mediacentos7u1# cp -a isolinux /tmp/ root@stivinstall mediacentos7u1# cd /tmp/isolinux/ As we're aiming to have everything in Text (console) mode, we should first get rid of graphical feature, like image. So, in the boot.msg, remove the ^Xsplash.lss line and delete the boot.cat (will be re-created later) root@stivinstall isolinux# cat boot.msg splash.lss - Press the 0107 key to begin the installation process. root@stivinstall isolinux# vim boot.msg.
'boot.msg' 4L, 72C written root@stivinstall isolinux# cat boot.msg - Press the 0107 key to begin the installation process. root@stivinstall isolinux# rm boot.cat rm: remove regular file ‘boot.cat’? Y Now, the main and most important modifications are to add/edit two main configuration in the isolinux.cfg:.
A new line with ' serial 1 9600' which indicates to IsoLinux to redirect the output to the Serial Console. Append 'console=ttyS1' to the Kernel Option (append initrd.). This is a kernel option that specifies what device to use as the primary console and its implies text as the Installation Mode. Below, I've made use of diff between the modified and an unmodified isolinux.cfg to highlight that modifications. HpiLO- help vm status=0 statustag=COMMAND COMPLETED Sat Aug 29 07: VM: Virtual media commands. HpiLO- power on status=0 statustag=COMMAND COMPLETED Sun Aug 30 08: Server powering on.
HpiLO- vsp Virtual Serial Port Active: COM2 Starting virtual serial port. Press 'ESC (' to return to the CLI Session. ProLiant System BIOS - P71 Copyright 1982, 2014 Hewlett-Packard Development Company, L.P. 2 Processor(s) detected, 4 total cores enabled, Hyperthreading is enabled Proc 1: Intel(R) Xeon(R) CPU E5-2637 0 @ 3.00GHz Proc 2: Intel(R) Xeon(R) CPU E5-2637 0 @ 3.00GHz. ISOLINUX 4.05 0x54f93f16 Copyright (C) 1994-2011 H. Peter Anvin et al We'll get to the following nice screen.
Where should I look in connecting to my server via a serial connection? (I'm more on the network end of things, and am hoping for a nudge in the right direction on these two Grokbase › Groups › CentOS › centos › February 2008.
Configure your Arch Linux machine so you can connect to it via the serial console port. This will enable you to administer the machine even if it has no keyboard, mouse, monitor, or network attached to it (a headless server). Installation of Arch Linux is possible via the serial console as well. A basic environment for this scenario is two machines connected using a serial cable (9-pin connector cable). The administering machine can be any Unix/Linux or Windows machine with a terminal emulator program (PuTTY or Minicom, for example).
The configuration instructions below will enable GRUB menu selection, boot messages, and terminal forwarding to the serial console. Contents. Configuration Configure console access on the target machine GRUB2 and systemd If you configure the serial console in GRUB2 systemd will create a getty listener on the same serial device as GRUB2 by default. So, this is the only configuration needed for Arch running with systemd. To make grub enable the serial console, open /etc/default/grub in an editor. Change the GRUBCMDLINEDEFAULT line to start the console on /dev/ttyS0. Note in the example below, we set two consoles up; one on tty0 and one on the serial port.
GRUBCMDLINELINUXDEFAULT='console=tty0 console=ttyS0,38400n8' Now we need to tell grub where is the console and what command to start in order to enable the serial console (Note as above for Linux kernel, one can append multiple input/output terminals in grub e.g. GRUBTERMINAL='console serial' would enable both display and serial): ## Serial console GRUBTERMINAL=serial GRUBSERIALCOMMAND='serial -speed=38400 -unit=0 -word=8 -parity=no -stop=1' Rebuild the grub.cfg file with following command: # grub-mkconfig -o /boot/grub/grub.cfg After a reboot, getty will be listening on /dev/ttyS0, expecting 38400 baud, 8 data bits, no parity and one stop bit. When Arch boots, systemd will automatically start a getty session to listen on the same device with the same settings. Without GRUB2, systemd only Ignore this entire section if you have configured GRUB2 to listen on the serial interface. If you do not want GRUB2 to listen on the serial device, but only want getty listening after boot then follow these steps.
To start getty listening on /dev/ttyS0 [email protected]. You can check to see the speed(s) getty is using with systemctl, but should be 38400 8N1: # systemctl status [email protected] Getty will be listening on device /dev/ttyS0 expecting 38400 baud, 8 data bits, no parity and one stop bit-times. GRUB v1 and No systemd Edit the GRUB config file /boot/grub/menu.lst and add these lines to the general area of the configuration: serial -unit=0 -speed=9600 terminal -timeout=5 serial console Add suitable console parameters (e.g. Change the serial device name or baud rate if required) at the end of your current kernel line: console=tty0 console=ttyS0,9600 For example, the kernel line should look something like this after modification: kernel /vmlinuz-linux root=/dev/md0 ro md=0,/dev/sda3,/dev/sdb3 vga=773 console=tty0 console=ttyS0,9600. Note: When the terminal -timeout=5 serial console line is added to your menu.lst grub configuration, your boot sequence will now show a series of 'Press any key to continue' messages.
If no key is pressed, the boot menu will appear on whichever (serial or console) appears first in the 'terminal' configuration line. The lines will look like this upon boot: Press any key to continue. Press any key to continue. Press any key to continue. Press any key to continue.
Press any key to continue. Press any key to continue. Press any key to continue. Next, we have to edit /etc/inittab and add a new agetty line below the existing ones: c0:2345:respawn:/sbin/agetty 9600 ttyS0 linux Edit /etc/securetty and add an entry for the the serial console, below the existing entries: ttyS0 Reboot. Note: Before making a connection, it is recommended to add your user to the uucp group. Otherwise you will need root's permission to make a connection: # gpasswd -a username uucp See for details.
Perform these steps on the machine used to connect the remote console. Command line dterm AUR is a tiny serial communication program. If you invoke it without parameters, it will connect to /dev/ttyS0 at 9600 baud by default.
The following example connect to /dev/ttyS0 at 115200 baud, with 8 data bits, no parity bit and 1 stop bit-times: $ dterm 115200 8 n 1 See its homepage for more examples. Minicom can be obtained from the official repositories. Start Minicom in setup mode: $ minicom -s Using the textual navigation menu, change the serial port settings to the following: Serial Device: /dev/ttyS0 Bps/Par/Bits: 9600 8N1 Press Enter to exit the menus (pressing Esc will not save changes). Remove the modem Init and Reset strings, as we are not connecting to a modem. To do this, under the Modem and Dialing menu, delete the Init and Reset strings. Optionally save the configuration by choosing save setup as dfl from the main menu. Restart minicom with the serial cable connected to the target machine.
To end the session, press Ctrl+A followed by Ctrl+X. Picocom is a tiny dumb-terminal emulation program that is very like minicom, but instead of mini, it is pico. The following example connect to ttyS0 at 9600 bps: $ picocom -b 9600 /dev/ttyS0. Note: if the backspace key won't work properly try out this option: '-omap delbs' See its manual for detailed usage. Screen is able to connect to a serial port.
It will connect at 9600 baud by default: $ screen /dev/ttyS0 A different baud rate (e.g. 115200) may be specified on the commmand line. Screen /dev/ttyS0 115200 To end the session, press Ctrl+a followed by k. Serialclient Serialclient is a CLI client for serial connection written in ruby. Install it with the following: # pacman -S ruby # gem install serialclient Then, you can use like this: $ serialclient -p /dev/ttyS0 And, for Windows On Windows machines, connect to the serial port using programs like PuTTY or Terminalbpp.
Graphical front-ends AUR is another gui enabled serial monitor. Is also available for Linux. Is a gtk-based serial terminal, primarily intended for technical users and hardware hackers who need to communicate with embedded systems, test equipment, and serial consoles. Installing Arch Linux using the serial console.
Note: The Arch Linux monthly release(i.e. The installation CD)'s boot loader has been configured to listen on 0 port( ttyS0/COM1) at 38400 bps, with 8 data bits, no parity bit and 1 stop bit-times. Connect to the target machine using the method described above. Boot the target machine using the Arch Linux installation CD.
When the bootloader appears, select Boot Arch Linux and press Tab to edit. Append console=ttyS0,38400 and press Enter.
Now systemd should detect ttyS0 and spawn a serial getty on it. Login as root and start the installation as usual.