xterm.js Interactive Console Configuration in Proxmox VE
Technical guide to enabling optimized xterm.js interactive terminals with clipboard support and dynamic resolution adjustment in VMs and LXC containers.
Enabling the xterm.js-based console instead of the native noVNC viewer provides a smooth interactive terminal with native browser copy-and-paste support, dynamic screen resizing, and superior rendering performance.
1. Configuration on Virtual Machines (VM)
Sección titulada «1. Configuración en Máquinas Virtuales (VM)»For VMs (e.g., Ubuntu Server) to channel their interactive terminal output to the Proxmox web interface, it is mandatory to provision a virtual serial port interface in the machine's hardware.
Step A: Provision the Serial Port on the Hypervisor
Sección titulada «Paso A: Aprovisionar el Puerto Serie en el Hipervisor»- Log in to the Proxmox VE web console.
- Select the virtual machine from the left sidebar menu.
- Navigate to the Hardware tab.
- Click on the Add dropdown button and select Serial Port.
- Add the serial port by assigning the index
0(Serial 0). - Select the Display graphics card in the hardware panel, click Edit, and change the driver to Serial terminal 0 (serial0).
- Click OK.
Step B: Configuration in the Guest Operating System (Guest OS)
Sección titulada «Paso B: Configuración en el Sistema Operativo Invitado (Guest OS)»If the virtual serial port is added in Proxmox but not enabled in the guest system's bootloader, the xterm.js console screen will appear black. It is imperative to instruct the Linux kernel to replicate its output:
- Access the virtual machine via a temporary SSH connection or through the graphical noVNC console.
- Edit the GRUB boot loader configuration file:
Ventana de terminal sudo nano /etc/default/grub - Locate the
GRUB_CMDLINE_LINUX_DEFAULTdirective and incorporate the serial console parameters (tty0andttyS0at a speed of 115200 bauds):- Previous configuration:
Ventana de terminal GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity" - Modified configuration:
Ventana de terminal GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200"
- Previous configuration:
- Save the changes (Ctrl + O, confirm with Enter and exit with Ctrl + X).
- Update the GRUB boot loader directives in the boot partition:
Ventana de terminal sudo update-grub - Restart the virtual machine's operating system to apply the kernel reconfiguration:
Ventana de terminal sudo reboot
2. LXC Container Configuration
Sección titulada «2. Configuración en Contenedores LXC»In LXC container environments (such as the security gateway lxc-portelcore-vpn-01), it is not necessary to add virtualized serial hardware, as Proxmox manages communication directly through native TTY interfaces.
Unique Procedure in LXC
Sección titulada «Procedimiento Único en LXC»- Select your LXC container in the Proxmox left sidebar tree.
- Navigate to the Options tab.
- Select the Console mode option and double-click on it.
- Modify the Default value to Shell.
- Click OK.
- Restart the LXC container to propagate the logical changes.
🚀 Access and Interaction with xterm.js
Sección titulada «🚀 Acceso e Interacción con xterm.js»Once the destination host has initialized:
- Go to the top right menu bar of the virtual machine or container and click on the Console drop-down button.
- Since the screen is configured in serial mode, the web console will automatically connect to the xterm.js terminal.
- If the monitor appears inactive or in standby, press Enter once to force the Linux authentication service to display the login prompt (
w-server-login:).
⚡ xterm.js Operation Checklist
Sección titulada «⚡ Checklist de Operación de xterm.js»- ✓ Hardware Serial: Interfaz virtual Serial 0 añadida y vinculada al controlador Display en Proxmox.
- ✓ Redirección de Kernel: Parámetro
console=ttyS0configurado en el cargador GRUB y compilado con éxito. - ✓ Terminal LXC: Parámetro de consola de contenedor ajustado a modo Shell y reiniciado correctamente.

