[SOLVED] Unable to use Xterm.js

Deleted member 33567

Guest
I have tried to use Xterm.js for all servers yet it is working only for main proxmox nodes.

We receive this:

Code:
unable to find a serial interface
Connection to 172.18.2.1 closed.
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,125
526
133
Austria
www.proxmox.com
You need to configure a serial VM console if you want to use that for VMs. But it should work out of the box for containers and the host shell.
 

Deleted member 33567

Guest
Any good directions to do so? I tried from GUI interface it seems this in version 5 still requires CLI changes and reboots... Why isn't Serial Console a standard in matters of configs standards?
 

Mitch Maris

Member
Feb 3, 2017
22
1
23
40
Hello @dietmar

I have also encountered this exact issue. When the initial shell (js) was made available it worked for all vm's just like the noVNC but after the latest series of updates I can no longer use xterm.js for my KVM vm's but it still works for the proxmox host.

proxmox-ve: 5.1-32 (running kernel: 4.13.13-2-pve)
pve-manager: 5.1-41 (running version: 5.1-41/0b958203)
pve-kernel-4.13.4-1-pve: 4.13.4-26
pve-kernel-4.13.8-2-pve: 4.13.8-28
pve-kernel-4.13.13-2-pve: 4.13.13-32
libpve-http-server-perl: 2.0-8
lvm2: 2.02.168-pve6
corosync: 2.4.2-pve3
libqb0: 1.0.1-1
pve-cluster: 5.0-19
qemu-server: 5.0-18
pve-firmware: 2.0-3
libpve-common-perl: 5.0-25
libpve-guest-common-perl: 2.0-14
libpve-access-control: 5.0-7
libpve-storage-perl: 5.0-17
pve-libspice-server1: 0.12.8-3
vncterm: 1.5-3
pve-docs: 5.1-12
pve-qemu-kvm: 2.9.1-5
pve-container: 2.0-18
pve-firewall: 3.0-5
pve-ha-manager: 2.0-4
ksm-control-daemon: 1.2-2
glusterfs-client: 3.8.8-1
lxc-pve: 2.1.1-2
lxcfs: 2.0.8-1
criu: 2.11.1-1~bpo90
novnc-pve: 0.6-4
smartmontools: 6.5+svn4324-1
zfsutils-linux: 0.7.3-pve1~bpo9
 

KHosting

Member
Mar 13, 2016
27
0
21
Hello @dietmar

I am in a similar situation, xterm works on how and I have tried to enable serial0 on the VM but when I try to connect, it stays forever on "starting serial terminal on interface serial0 (press Ctrl+O to exit)".

-------------------------------------------------------
root@LOCAL:~# qm status 216
status: running

root@LOCAL:~# qm config 216 | grep serial0
serial0: socket

root@LOCAL:~# qm terminal 216
starting serial terminal on interface serial0 (press Ctrl+O to exit)
-------------------------------------------------------
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,125
526
133
Austria
www.proxmox.com
I am in a similar situation, xterm works on how and I have tried to enable serial0 on the VM but when I try to connect, it stays forever on "starting serial terminal on interface serial0 (press Ctrl+O to exit)".

You need to configure the VM to run a console on the serial device ...
 

shantanu

Active Member
Mar 30, 2012
112
10
38
@dietmar, The Xterm.js seems to be a really nice addition. Keep up the enhancements!!!

Though I think this confusion about having to pre configure a serial port for QEMU/KVM will arise more and more.
Would it make sense to add the link to the serial configuration on the release notes' page to reduce the confusion ?

Regards,
Shantanu
 
Jun 29, 2018
27
1
8
40
Hi,
Anybody can explain how to configure the VM to run a console on the serial device? I want use xterm in my KVMs too.

I just added a serial port to the KVM machine as serial 0, but, what now?
If I click on xterm console, It opens and say: "starting serial terminal on interface serial0" but nothing
 

ignaqui

New Member
Jan 12, 2017
13
3
3
43
https://www.centos.org/forums/viewtopic.php?t=54984
In case anyone needs to setup console on Centos7 VM:

1) Edit the /etc/default/grub file. Append the console=ttyS0 statement to the grub config file at the end of the GRUB_CMDLINE_LINUX line: console=tty0 console=ttyS0,115200

2) Create the grub.cfg file:
BIOS:
grub2-mkconfig -o /boot/grub2/grub.cfg
EFI:
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

3) Enable a getty login service for ttyS0 with the systemctl command:
systemctl enable serial-getty@ttyS0.service

4) Shut down and start the server up
 
Last edited:
Jun 3, 2020
1
0
1
70
I used these instructions for setting up the console in debian vm (changing the console=tty0 to console=ttyS0,115200)

and if it complains about not finding "update-grub" use "su - root"

EDIT: Remembering to also enable a Serial socket in the VM setup
 
Last edited:

aleksdj

Member
May 1, 2019
8
0
6
42
Hello, after configuring correctly the terminal serial port to be able to access by xterm.js, the terminal window is not as good as with containers, for example, if you edit a file with an editor (like nano or vi) the terminal doesn't extend to the window size (like in containers), or even worse, when you enter a large command, the characters/lines get messed up like if it hadn't fit...

How can I configure the xterm/terminal/serial in VMs to act as good as in containers?

Screenshot 2022-04-11 at 13.31.20.png
 

LnxBil

Famous Member
Feb 21, 2015
6,468
819
163
Saarland, Germany
How can I configure the xterm/terminal/serial in VMs to act as good as in containers?
First, this is normal and it has been for the last 40y or more. You need stty for that and need a mechanism to resize your terminal window accordingly.

And to counter a possible follow-up-question ... no this cannot be integrated in PVE, it is a pure VM problem that needs to be solved there.
 
  • Like
Reactions: aleksdj

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!