edit /etc/default/grub and enable serial input and output support:

1
2
3
4
5
...
GRUB_TERMINAL_INPUT="console serial"
...
GRUB_TERMINAL_OUTPUT="gfxterm serial"
...

Next add the GRUB_SERIAL_COMMAND variable and set the options for the serial connection. For COM1 (/dev/ttyS0) with baud rate of 115200 bit/s:

1
2
...
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"

Then update-grub


参考资料:

  1. Working with the serial console
  2. Grub重定向到串口