Ir al contenido

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.

0views

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.


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»
  1. Log in to the Proxmox VE web console.
  2. Select the virtual machine from the left sidebar menu.
  3. Navigate to the Hardware tab.
  4. Click on the Add dropdown button and select Serial Port.
  5. Add the serial port by assigning the index 0 (Serial 0).
  6. Select the Display graphics card in the hardware panel, click Edit, and change the driver to Serial terminal 0 (serial0).
  7. 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:

  1. Access the virtual machine via a temporary SSH connection or through the graphical noVNC console.
  2. Edit the GRUB boot loader configuration file:
    Ventana de terminal
    sudo nano /etc/default/grub
  3. Locate the GRUB_CMDLINE_LINUX_DEFAULT directive and incorporate the serial console parameters (tty0 and ttyS0 at 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"
  4. Save the changes (Ctrl + O, confirm with Enter and exit with Ctrl + X).
  5. Update the GRUB boot loader directives in the boot partition:
    Ventana de terminal
    sudo update-grub
  6. Restart the virtual machine's operating system to apply the kernel reconfiguration:
    Ventana de terminal
    sudo reboot

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.

  1. Select your LXC container in the Proxmox left sidebar tree.
  2. Navigate to the Options tab.
  3. Select the Console mode option and double-click on it.
  4. Modify the Default value to Shell.
  5. Click OK.
  6. 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:

  1. Go to the top right menu bar of the virtual machine or container and click on the Console drop-down button.
  2. Since the screen is configured in serial mode, the web console will automatically connect to the xterm.js terminal.
  3. 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:).

  • ✓ Hardware Serial: Interfaz virtual Serial 0 añadida y vinculada al controlador Display en Proxmox.
  • ✓ Redirección de Kernel: Parámetro console=ttyS0 configurado en el cargador GRUB y compilado con éxito.
  • ✓ Terminal LXC: Parámetro de consola de contenedor ajustado a modo Shell y reiniciado correctamente.