"
If you are booting with a serial console, generally the kernel will autodetect this. If you have a videocard (framebuffer) and a keyboard also attached to the computer which you wish to boot via serial console, you may have to pass theconsole=
argument to the kernel, wheredevice
device
is your serial device, which is usually something likettyS0
.
You may need to specify parameters for the serial port, such as speed and parity, for instanceconsole=ttyS0,9600n8
; other typical speeds may be 57600 or 115200. Be sure to specify this option after “---”, so that it is copied into the bootloader configuration for the installed system (if supported by the installer for the bootloader).
In order to ensure the terminal type used by the installer matches your terminal emulator, the parameterTERM=
can be added. Note that the installer only supports the following terminal types:type
linux
,bterm
,ansi
,vt102
anddumb
. The default for serial console indebian-installer
isvt102
. If you are using an IPMI console, or a virtualization tool which does not provide conversion into such terminals types itself, e.g. QEMU/KVM, you can start it inside a screen session. That will indeed perform translation into thescreen
terminal type, which is very close tovt102
.
"
It also states,
"
Those used to change inittab to enable/disable virtual or serial consoles will notice that that file is gone from clean installs. This is all managed through systemd directly now. For example, you can enable a serial console on COM1 with:systemctl enable serial-getty@ttyS0.service systemctl start serial-getty@ttyS0.service
However, it is generally preferable to add console=ttyS0 on the kernel commandline, since this also enables kernel output on reboots. This is done by adding the following to /etc/default/grub:GRUB_CMDLINE_LINUX="console=ttyS0"... and running update-grub. This will take effect only on the next reboot, however.
"
It is clearly that the documentation offers two solutions, using the systemd service or using the boot parameter. Perhaps, the former has the shortcoming that the serial console may not start if the systemd does not get a chance to run because we happen to have a boot problem. The preferred method, as suggested is to pass a boot parameter to the kernel. Since I have the grub boot loader installed, this becomes a simple two step approach,
- Edit
/etc/default/grub
file. In my case, replaceGRUB_CMDLINE_LINUX_DEFAULT="quiet"
byGRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0 console=tty0"
- Update the
grub.cfg
fileupdate-grub -o /boot/grub/grub.cfg
I happened to back up the old
grub.cfg
file. By comparing the old and new grub.cfg
file, we can easily see the difference between the two files,
$ diff /boot/grub/grub.cfg /boot/grub/grub.cfg.bu01
diff /boot/grub/grub.cfg /boot/grub/grub.cfg.bu01
119c119
< linux /boot/vmlinuz-4.19.0-8-686 root=UUID=123456789 ro console=ttyS0 console=tty0
---
> linux /boot/vmlinuz-4.19.0-8-686 root=UUID=123456789 ro quiet
137c137
< linux /boot/vmlinuz-4.19.0-8-686 root=UUID=123456789 ro console=ttyS0 console=tty0
---
> linux /boot/vmlinuz-4.19.0-8-686 root=UUID=123456789 ro quiet
$
Thank you for the nice HOWTO. It helped me bringing by serial console to life :o)
ReplyDeleteThank You and I have a nifty provide: What House Renovations Need Council Approval for home renovation
ReplyDeleteRespect and that i have a super offer you: When Home Renovation hgtv brady bunch house
ReplyDelete