Ubuntu Serial Monitor



This article will describe changing GRUB2 and Linux to serial console.

The cu command is used to call up another system and act as a dial in terminal. To monitor the input I have tried using (Coolterm & GTKTerm), assuming an issue with the driver I have referred and tried updating the DTR line as the solutions suggested in the following stack overflow resources Reference 1,Reference 2,Reference 3. I have tied the same on the ubuntu based computer too but the issue remain the same. wsl -list -verbose NAME STATE VERSION. docker-desktop-data Stopped 2 docker-desktop Stopped 2 Ubuntu-18.04 Stopped 2 Fedora-32 Stopped 2 Ubuntu Stopped 1 The normal recommendation is to use WSL2 for installation of all new WSL distros. Vcomconnected FALSE Ubuntu Linux 14.04 - Use USB for Serial Monitor. Use USB for Serial Monitor ‎ 11:39 AM. 241 Views lpcware. You can not get the Monitor's serial number, but you can get the make & model once X is running: you can look for it in /var/log/Xorg.0.log, e.g. Grep '-' /var/log/Xorg.0.log or in.

This is not for desktop environment but embedded system and virtual machine environment.

Table of Contents

  • 4. Execution result

1 Why using serial console

The serial console is helpful for CUI environment.

  • An embedded system which has no monitor display like router can be operated by serial console with RS232C.
  • A virtual machine like KVM + libvirt can be operated by serial console with CUI tools like virsh.

2 /etc/default/grub

Change /etc/default/grub as below.

Serial
  • Change GRUB terminal to console and ttyS0. This will provide one GRUB to a monitor display and serial console.
  • Remove hidden parameter for avoiding 'no video mode activated' error. And change GRUB timeout from 10 seconds to 1 second.
  • Change linux kernel console to tty1 and ttyS0. This setting will be taken over to userland, and there will be two login prompt for tty1 and ttyS0.

3 grub-mkconfig

Update /boot/grub/grub.cfg with grub-mkconfig.

Reboot Ubuntu 16.04.

4 Execution result

GRUB to monitor display is as below.

GRUB to serial console is as below.

This article used 'sudo virsh console <vmname>' for connecting serial console.

Login prompt to monitor display is as below.

Ubuntu Serial Monitor

tty1 is displayed with press Ctrl + Alt + F1.

Login prompt to serial console is as below.

4.1 Single user mode / Recovery mode

Ubuntu serial monitor guiMonitor
  • When running single user mode, there will be two root prompt for tty1 and ttyS0.
  • When running recovery mode, there will be one root prompt for ttyS0. If you want to switch prompt to tty1, you need to move 'console=ttyS0,115200' to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub because recovery mode does not user GRUB_CMDLINE_LINUX_DEFAULT.
  • When running single user mode or recovery mode, root prompt for ttyS0 will be corrupted, e.g. noecho. Please append 'stty sane' to root.bashrc as below.

Ubuntu Serial Monitor App

A root prompt for ttyS0 with using 'stty sane' is as below.