特殊:Badtitle/NS100:SerialConsoleHowto
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/SerialConsoleHowto }} |
点击翻译: |
English {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/af | • {{#if: php5|Afrikaans| [[::SerialConsoleHowto/af|Afrikaans]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ar | • {{#if: php5|العربية| [[::SerialConsoleHowto/ar|العربية]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/az | • {{#if: php5|azərbaycanca| [[::SerialConsoleHowto/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/bcc | • {{#if: php5|جهلسری بلوچی| [[::SerialConsoleHowto/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/bg | • {{#if: php5|български| [[::SerialConsoleHowto/bg|български]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/br | • {{#if: php5|brezhoneg| [[::SerialConsoleHowto/br|brezhoneg]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ca | • {{#if: php5|català| [[::SerialConsoleHowto/ca|català]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/cs | • {{#if: php5|čeština| [[::SerialConsoleHowto/cs|čeština]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/de | • {{#if: php5|Deutsch| [[::SerialConsoleHowto/de|Deutsch]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/el | • {{#if: php5|Ελληνικά| [[::SerialConsoleHowto/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/es | • {{#if: php5|español| [[::SerialConsoleHowto/es|español]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/fa | • {{#if: php5|فارسی| [[::SerialConsoleHowto/fa|فارسی]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/fi | • {{#if: php5|suomi| [[::SerialConsoleHowto/fi|suomi]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/fr | • {{#if: php5|français| [[::SerialConsoleHowto/fr|français]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/gu | • {{#if: php5|ગુજરાતી| [[::SerialConsoleHowto/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/he | • {{#if: php5|עברית| [[::SerialConsoleHowto/he|עברית]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/hu | • {{#if: php5|magyar| [[::SerialConsoleHowto/hu|magyar]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/id | • {{#if: php5|Bahasa Indonesia| [[::SerialConsoleHowto/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/it | • {{#if: php5|italiano| [[::SerialConsoleHowto/it|italiano]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ja | • {{#if: php5|日本語| [[::SerialConsoleHowto/ja|日本語]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ko | • {{#if: php5|한국어| [[::SerialConsoleHowto/ko|한국어]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ksh | • {{#if: php5|Ripoarisch| [[::SerialConsoleHowto/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/mr | • {{#if: php5|मराठी| [[::SerialConsoleHowto/mr|मराठी]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ms | • {{#if: php5|Bahasa Melayu| [[::SerialConsoleHowto/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/nl | • {{#if: php5|Nederlands| [[::SerialConsoleHowto/nl|Nederlands]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/no | • {{#if: php5|norsk| [[::SerialConsoleHowto/no|norsk]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/oc | • {{#if: php5|occitan| [[::SerialConsoleHowto/oc|occitan]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/pl | • {{#if: php5|polski| [[::SerialConsoleHowto/pl|polski]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/pt | • {{#if: php5|português| [[::SerialConsoleHowto/pt|português]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ro | • {{#if: php5|română| [[::SerialConsoleHowto/ro|română]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/ru | • {{#if: php5|русский| [[::SerialConsoleHowto/ru|русский]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/si | • {{#if: php5|සිංහල| [[::SerialConsoleHowto/si|සිංහල]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/sq | • {{#if: php5|shqip| [[::SerialConsoleHowto/sq|shqip]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/sr | • {{#if: php5|српски / srpski| [[::SerialConsoleHowto/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/sv | • {{#if: php5|svenska| [[::SerialConsoleHowto/sv|svenska]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/th | • {{#if: php5|ไทย| [[::SerialConsoleHowto/th|ไทย]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/tr | • {{#if: php5|Türkçe| [[::SerialConsoleHowto/tr|Türkçe]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/vi | • {{#if: php5|Tiếng Việt| [[::SerialConsoleHowto/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/yue | • {{#if: php5|粵語| [[::SerialConsoleHowto/yue|粵語]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/zh | • {{#if: php5|中文| [[::SerialConsoleHowto/zh|中文]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/zh-hans | • {{#if: php5|中文(简体)| [[::SerialConsoleHowto/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}SerialConsoleHowto}}/zh-hant | • {{#if: php5|中文(繁體)| [[::SerialConsoleHowto/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:php5|:SerialConsoleHowto|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :SerialConsoleHowto/zh | | {{#ifexist: SerialConsoleHowto/zh | | {{#ifeq: {{#titleparts:SerialConsoleHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:SerialConsoleHowto|1|-1|}} | zh | | }}
This document presents (almost) the minimum amount of work required to enable a serial console login on an Ubuntu 6.06 installation. (Minor changes have been added to improve performance) Both server and client settings are included.
This procedure was developed using the Remote Serial Console HOWTO ([ http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html]), and adapted to apply specifically to Ubuntu 6.06. 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.
- The serial connection is being made at 115200 baud 8n1, on console port /dev/ttyS0 (9600 8n1 is the default fall back if your hardware does not support 115200 baud)
- You are comfortable editing critical system files such as /etc/inittab, /boot/grub/menu.lst
- You are using a serial (null modem) cable. It is also possible to use a USB to Serial adaptor, but the tty* must be changed to reflect your hardware.
Note: an excellent resource is: http://www.lammertbies.nl/comm/cable/yost-serial-rj45.html which will show you how to make Serial to Cat 5 adaptors.
Server Setup
Configuring the console login process
This section details how to configure the 'getty' process to enable a login via the console port.
1) Edit /etc/inittab
sudo vi /etc/inittab
2) Change the following line:
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
to:
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
3) Restart init:
sudo /sbin/telinit q
At this point, a new login prompt should appear on the output of the serial console.
Configuring grub
This section details how to get grub talking via the serial port.
This section is optional if the user does not want grub interaction via the serial console port.
1) Edit /boot/grub/menu.lst:
vi /boot/grub/menu.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 1 is /dev/ttyS1... serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=15 serial console
3) When you next reboot, the output from grub will go to the normal console unless input is received from the serial port. Whichever receives input first becomes the default console. This gives you the best of both worlds.
Configuring the kernel boot parameters
This section details how to configure the kernel boot parameters to get boot information through the console port.
This section is optional if the user does not want the kernel boot messages to appear on the serial console port.
The following procedure can be carried out by modifying the 'kernel' line in grub prior to committing the changes directly to the /boot/grub/menu.lst file.
1) Edit /boot/grub/menu.lst:
sudo vi /boot/grub/menu.lst
2) Modify the kernel line for the image you want to boot using the serial console on. In this case, I'm setting up the default 2.6.10-5.386 kernel to use the serial console line. Change:
title Ubuntu, kernel 2.6.10-5-386 root (hd0,0) kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro quiet splash initrd /boot/initrd.img-2.6.10-5-386 savedefault boot
to:
title Ubuntu, kernel 2.6.10-5-386 root (hd0,0) kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro quiet splash console=tty0 console=ttyS0,115200n8 initrd /boot/initrd.img-2.6.10-5-386 savedefault boot
NOTE: the first console parameter is 'console=tty0', not ttyS0
3) Reboot into this kernel. Output from the boot process should be sent via the serial console line.
Client Setup
1) Install minicom
sudo apt-get install minicom
2) Configure minicom.
sudo minicom -s
3) Configure client serial port settings: In Serial port setup, set the following options
A - Serial device: /dev/ttyS0 E - Bps/Par/Bits: 115200 8N1
4) Configure Initialization string: In Modem and dialing clear the init
A - Init string .....
5) Save setup as dfl
6) You might need to press enter several times to get the connection running.
7) To log on in the future, run
sudo minicom
and press enter several times if it does not come up on start up.
CategoryDocumentation