Real-world Scenario: When SSH Suddenly Goes Silent
System administrators are no strangers to this: you hit Enter to restart a service after tweaking a Netplan or Firewall file, then boom—the terminal freezes. You’ve officially lost SSH access. With a physical machine, you can run to the server room and plug in a monitor. But for a VM in a datacenter hundreds of miles away, using VNC via a browser is often slow, laggy, and prone to font issues.
Serial Console is the perfect alternative. In my lab environment running 15 VMs, setting up Serial Console allows me to jump straight into the VM’s shell from the host in just a second. It’s fast, smooth, and most importantly, independent of the VM’s virtual network interface card (NIC).
Quick Start: Set Up in 5 Minutes
The process involves two main steps: defining the virtual hardware on the Host and configuring the software inside the Guest (VM).
Step 1: Add the Serial Device on the Host
For Proxmox VE:
- Access Web UI -> Select VM -> Hardware -> Add -> Serial Port.
- Select 0 (Serial port 0) and click Add.
- Go to the Options tab -> Console Viewer -> Change to Serial terminal 0 (xterm.js).
For KVM (Command Line):
# Edit the VM's XML file
virsh edit <vm_name>
# Add the following lines inside the <devices> tag
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
Step 2: Configure Inside the Linux VM
SSH into the VM one last time (or use the default console) to edit the GRUB file:
sudo nano /etc/default/grub
Find and update the following parameters so the Kernel knows to output data to the Serial port:
GRUB_CMDLINE_LINUX_DEFAULT="quiet console=tty0 console=ttyS0,115200"
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Finally, update the boot configuration and reboot:
sudo update-grub
sudo reboot
Why use `console=ttyS0,115200`?
By default, Linux prioritizes outputting video to tty0 (the virtual VGA screen). By adding ttyS0, you are telling the Kernel to duplicate that data stream to the Serial port. The 115200 baud rate is the current gold standard. It’s fast enough to display long log messages without the lag seen in the old 9600 speed.
The biggest advantage of xterm.js (Serial) over traditional noVNC is the ability to copy-paste. You can paste a long script from your personal computer directly into the VM’s terminal. This is nearly impossible using VNC’s bitmap-based console interface.
Admin Tips and Troubleshooting
Lightning-Fast Access from the Host Terminal
If you are on the KVM Host, there’s no need to waste time opening the Web UI. Simply run the following command:
virsh console <vm_name>
To exit, press the Ctrl + ] key combination. Note: If the screen stays blank after running the command, press Enter once more to bring up the login prompt.
Fixing Black Screen Issues on Proxmox
If you encounter the message “Guest has not initialized the display (yet)”, it’s usually because you haven’t run update-grub inside the VM or the Serial device is missing from the Hardware settings. Use the qm config <vmid> command on the host to check if the serial0 line exists.
Notes for RedHat/CentOS Distributions
For CentOS or RHEL, the GRUB update command differs depending on the boot mode:
# For BIOS
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
# For UEFI
sudo grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
Real-World Experience
In production environments, I always consider Serial Console as part of the security and recovery standard.
- Automation: Add these GRUB configurations to your Cloud-init scripts or VM Templates. This way, every new VM will have a secure “backdoor” for troubleshooting.
- Network Recovery: If you accidentally delete an interface configuration file, Serial Console is the only way to re-enter the IP without having to shut down the VM and mount the virtual disk externally.
- Security: Since Serial Console allows root access, strictly limit access to the Host machine via RBAC mechanisms.
Hopefully, this small tip helps you feel more confident when “tinkering” with your systems without the fear of being locked out!

