Serial console - how to set up?

Is there a HOWTO to set up Clear Linux to use a serial console? My use case is to expose the serial console out from Clear to a virtualization server to get a better console experience.

Here’s the Ubuntu example: SerialConsoleHowto - Community Help Wiki

Here is the RHEL example: https://access.redhat.com/articles/3166931

I dug into this item and have a solution for Proxmox VE:

Add Serial Console Parameters

Clear Linux stores kernel arguments in /etc/kernel/cmdline.d/.

sudo mkdir -p /etc/kernel/cmdline.d
echo "console=tty0 console=ttyS0,115200n8" | sudo tee /etc/kernel/cmdline.d/serial-console.conf

Update the Boot Manager

Apply the changes by regenerating the kernel configuration:

sudo clr-boot-manager update

Enable the Serial Getty Service

Enable the serial console login service for the correct port:

sudo systemctl enable serial-getty@ttyS0.service

At this point you can halt or reboot. In Proxmox, I set Display to Serial Terminal 0 (serial0) and then restarted the VM.

Benefit in Proxmox

Now the display output in the Proxmox VE browser window is selectable for cut’n’paste where previously, the only option was to ssh into the VM for any cut’n’paste actions.

Serial console should have worked out of the box:

systemd for Administrators, Part XVI

TL;DR: To make use of a serial console, just use console=ttyS0 on the kernel command line, and systemd will automatically start a getty on it for you.

This guide also discusses consoles provided by VMs, which might be more relevant.

Thanks for your notes. My quick write-up was the solution found since Clear Linux doesn’t work fully out of the box with Proxmox.

Out of the box, one gets an impaired Clear Linux console in Proxmox. By impaired, I mean that you can see the serial console output, you can type in the serial console, but it’s not possible to copy from or paste into the serial console.

After applying my solution, these usability warts are removed.