how to dertermin what port serial is on ubuntu

Tag/tag.png

Content Cleanup Required
This article should be cleaned-up to follow the content standards in the Wiki Guide. More than info...

This document presents (nearly) the minimum amount of work required to enable a serial console login on an Ubuntu 6.06 and after versions. (Minor changes have been added to meliorate performance.) Both server and client settings are included.

This procedure was developed using the Remote Series Panel HOWTO (see "External links" below), and adapted to apply specifically to Ubuntu. The reader is referred to this document for any issues arising from using this HOWTO.

Assumptions

  • You have enabled the serial console in your BIOS.1

  • The serial connection is beingness made at 115200 baud 8n1, on commencement serial port, called /dev/ttyS0 in linux (9600 8n1 is the default autumn dorsum if your hardware does not support 115200 baud)
  • You are comfy editing critical system files such as /etc/inittab, /boot/grub/carte du jour.lst
  • You are using a series (null modem) cable. Information technology is as well possible to use a USB to Series adaptor, but the tty* must be changed to reflect your hardware.
  • You accept an available series panel on ttyS0. If your not getting any output, a real serial port or other device might be using ttyS0. Endeavour using ttyS1, ttyS2, etc.

If you want to employ a standard Ethernet/RJ-45 cablevision for serial connection you tin can purchase a couple of Series to Cat 5 adapters or brand one yourself.

Server Setup

Configuring the panel login procedure

This section details how to configure the 'getty' process to enable a login via the panel port. You lot demand to configure either an Upstart organisation or the older inittab, depending on Ubuntu version you are using.

Configuring upstart (Karmic and newer)

ane) Create a file called /etc/init/ttyS0.conf containing the following:

          # ttyS0 - getty          #          # This service maintains a getty on ttyS0 from the point the system is          # started until it is shut downwards once again.                    start on stopped rc RUNLEVEL=[12345]          terminate on runlevel [!12345]                    respawn          exec /sbin/getty -L 115200 ttyS0 vt102

2) Ask upstart to outset the getty

          sudo start ttyS0

Configuring upstart (Edgy/Feisty/Jaunty)

Create a file chosen /etc/event.d/ttyS0 containing the following:

          # ttyS0 - getty          #          # This service maintains a getty on ttyS0 from the bespeak the system is          # started until it is shut down again.                    outset on runlevel 1          start on runlevel 2          first on runlevel 3          start on runlevel four          start on runlevel 5                    finish on runlevel 0          stop on runlevel 6                    respawn          exec /sbin/getty 115200 ttyS0

Configuring inittab (just Dapper and older !)

one) Edit /etc/inittab

          sudo six /etc/inittab

2) Alter the post-obit line:

          #T0:23:respawn:/sbin/getty -Fifty ttyS0 9600 vt100

to:

          T0:123:respawn:/sbin/getty -50 ttyS0 115200 vt100

3) Restart init:

          sudo /sbin/telinit q

At this indicate, a new login prompt should appear on the output of the serial console.

Configuring chow

This section details how to get grub talking via the series port.

This section is optional if the user does not want chow interaction via the serial console port.

Configuring (Karmic and newer)

ane) Edit /etc/default/grub

          # If you change this file, run 'update-chow' later to update          # /kicking/grub/grub.cfg.                    GRUB_DEFAULT=0          GRUB_TIMEOUT=1          GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || repeat Debian`          GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"                    # Uncomment to disable graphical terminal (chow-pc only)          GRUB_TERMINAL=serial          GRUB_SERIAL_COMMAND="serial --speed=115200 --unit of measurement=0 --word=8 --parity=no --stop=one"                    # The resolution used on graphical last          # notation that you can employ only modes which your graphic carte du jour supports via VBE          # yous can see them in existent Grub with the command `vbeinfo'          #GRUB_GFXMODE=640x480                    # Uncomment if you don't want Grub to laissez passer "root=UUID=30" parameter to Linux          #GRUB_DISABLE_LINUX_UUID=truthful

two) update chow

 update-grub

Configuring grub (Edgy/Feisty/Jaunty)

one) Edit /boot/chow/menu.lst:

          half-dozen /boot/grub/card.lst

2) Add the following lines to the top of the file:

          # Enable console output via the serial port. unit 0 is /dev/ttyS0, unit of measurement ane is /dev/ttyS1...          serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1          terminal --timeout=15 series console

three) When y'all next reboot, the output from grub volition get to the normal panel unless input is received from the series port. Whichever receives input first becomes the default panel. This gives you the best of both worlds.

Configuring the kernel boot parameters

This department details how to configure the kernel boot parameters to get boot data through the console port.

This section is optional if the user does non want the kernel kicking letters to announced on the serial panel port.

The post-obit procedure can be carried out by modifying the 'kernel' line in chow prior to committing the changes directly to the /boot/grub/menu.lst file.

1) Edit /boot/chow/card.lst:

          sudo six /boot/grub/menu.lst

2) Change the kernel line for the image you want to boot using the serial console on. In this case, I'm setting up the default ii.six.10-5.386 kernel to apply the serial panel line. Change:

          title           Ubuntu, kernel ii.6.ten-5-386          root            (hd0,0)          kernel          /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro quiet splash          initrd          /kicking/initrd.img-two.half-dozen.10-5-386          savedefault          boot

to:

          title           Ubuntu, kernel 2.six.10-5-386          root            (hd0,0)          kernel          /boot/vmlinuz-two.6.ten-5-386 root=/dev/hda1 ro vga=normal console=tty0 panel=ttyS0,115200n8          initrd          /boot/initrd.img-2.vi.ten-5-386          savedefault          boot

Annotation two "panel=" kernel options. You can specify this option several times. All devices, mentioned in it will receive kernel messages (those, generated by printk() and seen by dmesg). Still, stdin/stdout/stderr of /sbin/init procedure will be set to the last device only, therefore only the final device volition show startup letters and act as a panel in unmarried-user mode.

3) Reboot into this kernel. Output from the kick procedure should be sent via the serial console line.

Client Setup

ane) Ensure you lot have a read/write permissions on /dev/ttyS0.

          $ ls -50 /dev/ttyS0          crw-rw---- 1 root dialout four, 64 2007-12-20 xiii:56 /dev/ttyS0          $ id -Gn |grep dialout

if the last command didn't show an output add yourself to dialout group and logout/login:

          sudo adduser $USER dialout

Alternatively, you tin e'er run minicom through sudo, but it's non recommended.

2) Install minicom

          sudo apt-go install minicom

3) Configure minicom.

          minicom -s

iv) Configure customer serial port settings: In Serial port setup, set the post-obit options

          A - Serial device: /dev/ttyS0          E - Bps/Par/$.25: 115200 8N1

4b) Using seven.x on the server, I needed to set the following on the client:

          F - Hardware Menses Control : No

My 7.10 client and Windows' HyperTerminal both defaulted to Aye; until I changed this client -> server advice did not piece of work.

v) Configure Initialization string: In Modem and dialing clear the init

          A - Init string .....        

vi) Save setup as dfl

vii) You might need to printing enter several times to get the connexion running.

8) To log on in the future, run

          minicom

and press enter several times if it does not come on kickoff up.

Alternative series client: screen

GNU screen actually makes quite a capable serial terminal.

To install:

          sudo apt-become install screen

To start:

          screen /dev/ttyS0 115200

(arrange to requirements)

To end the session, use Ctrl-A,Shift-1000.

  • Serial Console Howto

  • Serial Console

polanskyaciatur.blogspot.com

Source: https://help.ubuntu.com/community/SerialConsoleHowto

0 Response to "how to dertermin what port serial is on ubuntu"

Enregistrer un commentaire

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel