sudo apt-get install minicom ls /dev/
Use the tty interface for your serial port. Mine was ttyUSB0 since I used a USB dongle.<br /> NOTE: Needs to be run as root or change permissions on the tty device. The '-s' option starts minicom in the setup window.
sudo minicom -s
Set the device and configure settings.<br /> Save as default
This document presents (almost) the minimum amount of work required to enable a serial console login on an Ubuntu 6.06 and later versions. (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 (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.
“https://help.ubuntu.com/community/SerialConsoleHowto#fnref-4630b2079d69e5d0212e584145e50a6c70a1491f” id
“fndef-4630b2079d69e5d0212e584145e50a6c70a1491f-0”>1</a></p>“Server Setup”>Server Setup</h2>
==== Configuring the console login process ====
This section details how to configure the 'getty' process to enable a login via the console port. You need to configure either an Upstart system or the older inittab, depending on Ubuntu version you are using.
Configuring upstart(Karmic and newer)
1) Paste the following into /etc/init/ttyS0.conf
<code># ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL
[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -L 115200 ttyS0 vt102</code>
2) Ask upstart to start the getty
<code>sudo start ttyS0</code>
Configuring upstart(Edgy/Feisty/Jaunty)
Paste the following into /etc/event.d/ttyS0
<code># ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6
respawn
exec /sbin/getty 115200 ttyS0</code>
Configuring inittab(only Dapper and older !)
1) Edit /etc/inittab
<code>sudo vi /etc/inittab</code>
2) Change the following line:
<code>#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100</code>
to:
<code>T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100</code>
3) Restart init:
<code>sudo /sbin/telinit q</code>
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.
Configuring(Karmic and newer)
1) Edit /etc/default/grub
<code># If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT0
GRUB_TIMEOUT
1
GRUB_DISTRIBUTOR`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT
“consoletty0 console
ttyS0,115200n8”
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINALserial
GRUB_SERIAL_COMMAND
“serial –speed115200 –unit
0 –word8 –parity
no –stop1”
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE
640×480
# Uncomment if you don't want GRUB to pass “rootUUID
xxx” parameter to Linux
#GRUB_DISABLE_LINUX_UUIDtrue</code>
2) update grub
update-grub
Configuring grub(Edgy/Feisty/Jaunty)
1) Edit /boot/grub/menu.lst:
<code>vi /boot/grub/menu.lst</code>
2) Add the following lines to the top of the file:
<code># Enable console output via the serial port. unit 0 is /dev/ttyS0, unit 1 is /dev/ttyS1…
serial –unit
0 –speed115200 –word
8 –parityno –stop
1
terminal –timeout15 serial console</code>
3) When you next reboot, the output from grub will go to the normal consoleunless 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:
<code>sudo vi /boot/grub/menu.lst</code>
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:
<code>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</code>
to:
<code>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 consolettyS0,115200n8
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot</code>
Note two “console
” 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). However, stdin/stdout/stderr of /sbin/init
process will be set to the last device only, thereforeonly the last device will show startup messages and act as a console in single-user mode.
3) Reboot into this kernel. Output from the boot process should be sent via the serial console line.
<h2 id“Client Setup”>Client Setup</h2>
1) Ensure you have a read/write permissions on /dev/ttyS0.
<code>$ ls -l /dev/ttyS0
crw-rw—- 1 root dialout 4, 64 2007-12-20 13:56 /dev/ttyS0
$ id -Gn |grep dialout</code>
if the last command didn't show an output add yourself to
dialout group and logout/login:
<code>sudo adduser $USER dialout</code>
Alternatively, you can always run minicom through sudo, but it's not recommended.
2) Install minicom
<code>sudo apt-get install minicom</code>
3) Configure minicom.
<code>minicom -s</code>
4) Configure client serial port settings: In Serial port setup, set the following options
<code>A - Serial device: /dev/ttyS0
E - Bps/Par/Bits: 115200 8N1</code>
4b) Using 7.10 on the server, I needed to set the following on the client:
<code>F - Hardware Flow Control : No</code>
My 7.10 client and Windows' HyperTerminal both defaulted to Yes; until I changed this client -> server communication did not work.
5) Configure Initialization string: In Modem and dialing clear the init
<code>A - Init string ….. </code>
6) Save setup as dfl
7) You might need to press enter several times to get the connection running.
8) To log on in the future, run
<code>minicom</code>
and press enter several times if it does not come up on start up.
<h2 id
“External links”>External links</h2>
* https://help.ubuntu.com/community/SerialConsoleHowto
* Serial Console Howto
* Setup Serial Console with GRUB bootloader
* Serial Console
- <p>This is only needed if you plan to use serial console to enter BIOS configuration utility or observe early startup messages even before GRUB starts. Note, that in some cas1es it may interfere with GRUB settings described below. If you're sure you've configured GRUB correctly, but the serial menu does not appear, trydisabling** serial console support in BIOS.</p>– Main.FredPettis - 2010-10-13