Enable serial console on Ubuntu 20.04

/etc/default/grub:

## remove (optional):
# GRUB_TIMEOUT_STYLE=hidden

## change:
# (optional)
# GRUB_TIMEOUT=0
GRUB_TIMEOUT=2

## add:
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200"

## change:
# GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"

With GRUB_TERMINAL="console serial", GRUB menu appears in both VGA console and serial terminal.

If you can’t see the serial output, consult the manual and adjust GRUB_SERIAL_COMMAND="serial --speed=115200" to your hardware.

Finally, GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200" is Linux kernel’s command-line parameter. Like GRUB_TERMINAL="console serial", this enables tty in/out on both VGA console (tty1) and serial console (ttyS0).

 

After editing /etc/default/grub, execute sudo update-grub. This will execute grub-mkconfig -o /boot/grub/grub.cfg internally and modifies /boot/grub/grub.cfg, which is actually loaded on the boot.

After reboot, we can see dmesg and login prompt on the serial console!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值