Skip to main content

One post tagged with "debian"

View All Tags

· 3 min read

Why Use a Serial Console?

Using a serial console, as documented for Proxmox VE (a qemu/kvm virtualization tool), allows direct connection to your running VMs. It's an efficient alternative to VNC, providing solutions for capturing detailed messages during system failures which might be impossible on a VNC screen.

Here’s a practical example:

qm status 101
# Output: status: running
qm terminal 101
# Output: starting serial terminal on interface serial0 (press control-O to exit)

Setting Up Serial Console Access in Ubuntu 20+

Configuration on the Host Node

  1. Add a Virtual Serial Port to the VM: For VM ID 101, open the node's Shell.
  2. Edit VM Configuration:
    • Open /etc/pve/qemu-server/101.conf, add serial0: socket at the end of the file.
    • Alternatively, use qm set 101 -serial0 socket.
  3. Reboot the VM: Ensure the serial port option in the VM's hardware settings is correctly saved.

Unsaved Serial Port Setting

Unsaved Serial Port Setting

Saved Serial Port Setting

Saved Serial Port Setting

Configuring GRUB and Linux Boot Parameters in the Ubuntu VM/Guest

In your Ubuntu VM, open terminal:

  1. Backup GRUB Configuration first:
    sudo cp -nv /etc/default/grub /etc/default/grub.bak
  2. Edit GRUB Configuration:
    • Open /etc/default/grub using sudo vi /etc/default/grub.
    • Find the GRUB_TERMINAL line and modify it to GRUB_TERMINAL="console serial".
    • Find the GRUB_CMDLINE_LINUX_DEFAULT line and update it to GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200"
  3. Update GRUB:
    sudo update-grub

Once all done, reboot the VM.

Validate Serial Port

After completing the above steps, it's crucial to validate that the serial port is functioning correctly:

  1. Go to the node's Shell, try qm terminal 101 (assuming VM Id is 101). You should get output starting serial terminal on interface serial0
  2. Go to the VM's Console tab, on the top right toolbar, click on the Console dropdown, and ensure that the xterm.js option is enabled as below
Validate Serial Port via xtermjs

Connecting to the VM via ProxMobo Terminal

ProxMobo simplifies the process of connecting to your VM via a serial console in your phone. Here's how you can do it:

  1. Open ProxMobo: Navigate to your VM.
  2. Access Serial Console: Open the Terminal either from the ... menu, or from the CONSOLE section at the bottom of the VM view
Connecting to the VM via ProxMobo Terminal