1 This is a howto about booting Linux without a
2 traditional screen and through a serial line.
4 It is often the only method for servers. But it can be generally
5 useful for debugging, by allowing logging of the boot messages, which
6 scroll too fast on a VGA screen and are not fully kept in
9 The method is unlikely to be useful for out of the box modern
10 desktops/laptops/notebooks, as there have no more a serial
11 port. Emulation of a serial port through USB can't work here, as we
12 are too early in the boot process. In that case, and if your hardware
13 allows, you will have to plug in some serial port extension card.
15 I will in the following limit the scope to what I use: the IA-32
16 and derived architectures, but any information about other ones is
19 # Controlling boot through the serial line
21 ## Serial line configuration at the booting computer side
23 To have a complete boot experience through the serial line, you have to:
25 1. manage to get the BIOS I/O go through the serial line
26 1. configure a bootloader like GRUB to use the serial line
27 1. configure the kernel to output boot messages to the serial line
28 1. get a login prompt on the serial line
30 ### Manage to get the BIOS I/O go through the serial line
32 On servers it may be the only method, but it is unlikely to exist on a
33 desktop BIOS. In that case, you will miss the BIOS messages on the
36 ### Configure a bootloader like GRUB to use the serial line
38 On GRUB 1 or GRUB 2 you simply have to add these lines in the
39 GRUB configuration file:
41 # insmod is GRUB 2 specific, comment out for GRUB 1
43 serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
46 ### Configure the kernel to output boot messages to the serial line
48 To get kernel messages on the serial line, you have to add a
49 new option to the kernel command line, like:
53 which means 9600 bauds, no parity and 8 bits, to fit the previous
54 section 4 lines. This will also involve editing GRUB configuration
55 file. It may be unnecessary to do that if you use a server without a
56 VGA card, Linux is clever enough to try a serial port in that case.
58 If you are using Debian, you can configure items 2 and 3 the Debian
59 way, see for instance:
60 [[http://linux.xvx.cz/2009/08/debian-with-grub2-and-serial-connection/]]
62 Notice that you can't use arrows to navigate the GRUB menus when on
63 serial line, other standard keys are offered to that effect on the
66 ### Get a login prompt on the serial line
68 It is covered in that page: [[recovering_when_locked_out_from_your_computer]].
70 ## The other end of the serial line: hardware terminal or emulation
72 In any case, you will need a [null modem](http://www.lammertbies.nl/comm/info/RS-232_null_modem.html) to link the
73 booting host and the terminal (real dumb serial terminal or computer
76 Even if your computer emulating a terminal has no serial port, you can
77 use an USB port with a hardware adapter and a Linux driver, look
78 here: [[recovering_when_locked_out_from_your_computer]].
80 # Recording the boot messages
82 At that point, you should be able to get boot messages through the
83 serial line and then a login prompt.
85 When you boot through a traditional VGA screen, you can only study
86 back at most aroung 50 lines, depending on screen definition. While
87 through an emulated serial terminal, you are free to record the full
91 [[recovering_when_locked_out_from_your_computer]]) can record what is sent/received on the serial line, see
92 option "Capture on/off" in the menu, it has hotkey L.
94 But other tools are more convenient. I suggest you use ttyrec. To
95 register in file ttyrecord what happens during a minicom session, run:
99 When you are done with minicom, you can replay the session with:
103 To stop replay at some point, hit Ctrl-S; to resume hit Ctrl-Q. See
104 ttyrec man page for how to tune the general speed of the replay.