Saturday, November 11, 2017

enable tty on serial console port

1-edit grub.cfg (/bott/grub/) on linuxoption, on srial 0

linux    /boot/vmlinuz-4.9.0-15-generic root=UUID=99999999999999999999 ro text $vt_handoff console=tty0 console=ttyS0,115200n8

-then reboot

2- now we connect to to it on other computer from serial with command
$ screen /dev/ttyS0 115200

Ctrl+a c : create new terminal
Ctrl+a n: switch between tab
Ctrl+a d: detect


1- if we don't edit grub menu wan to enable console on serial port we can do with agetty,

-with bash without login
$ agetty.  -l /bin/bash 115200 ttyS0  --skip-login

or with zsh
$ agetty  -l /bin/zsh  115200 ttyS0 -N --skip-login

or with login
$ agetty -L  115200 ttyS0 vt100

2- on client we can use with screen or mincom to access it

$ screen /dev/ttyS0 115200

or minicom

$ minicom -D /dev/ttyS0 -b 115200

 if we access to window, we have to translate newline, so create or edit file    ~/.minirc.dfl add the line below

pu addcarreturn    Yes

1 comment:

  1. I am a tech geek since my childhood and have been following many tech blog. I was in a need of console connectivity instruction and found this and glad that it worked for me.