Support for xterm.js console by default for specific vm.

tlex

Active Member
Mar 9, 2021
106
15
38
44
Good day,

I've enabled a serial console on a few vm that support it on one of my hosts and I'm able to select and initiate a serial console session on them by selecting "xterm.js" in the right dropdown menu of the web gui but I would like to know if it is possible anyhow to make this the default view mode when accessing the console from the left "console" button like it is the case when accessing CT consoles or even host shell.
I understand the NoVnc will interact with the serial console as xterm.js does but the resolution is always blurry.
Would that be a feature request or is there anyway to force it in the vm config file ?

Thanks :)
 
I tried both changing the setting from the gui and directly in the datacenter.cfg file and that didn't change anything, the vm console falls back to novnc (when accessing the console from the left "console"button") where when I click the drop down console (right) and select xterm.js (that opens a new console window in xterm.js mode as expected)
 
So just to expose my "problem", I made a quick video.
As shown:

- "Xterm.js" is set as the default console mode at the Datacenter level.
- Containers (and host shell) consoles works as expected using xterm.js
- VM is not using xterm.js as the default mode (thats my issue)
- Xterm.js will only work when initiated from the right "console" menu

Any idea ?
https://www.youtube.com/watch?v=PgvuKog38CU
 
I did not realize that you used the Console tab of the VM before your video. Maybe it is a bug that the Console tab does not use the default console or maybe it is designed this way? The same happens to me, but I never use the Console tab of the VM.

What happens if you don't go the the Console tab of the VM but press the Console button? (And don't use the menu of the Console button but press on the left or middle of the Console button?) Or when you right-click on the VM and then click the Console from that context menu? I expect both to use the default console you set (xterm.js).
 
I did not realize that you used the Console tab of the VM before your video. Maybe it is a bug that the Console tab does not use the default console or maybe it is designed this way? The same happens to me, but I never use the Console tab of the VM.

What happens if you don't go the the Console tab of the VM but press the Console button? (And don't use the menu of the Console button but press on the left or middle of the Console button?) Or when you right-click on the VM and then click the Console from that context menu? I expect both to use the default console you set (xterm.js).
Doing so will open noVnc as well sadly. The only way to start the console for a vm with xterm.js will be to right-click the right console button and select xterm.js :( (at least in my case !) - Right clicking the vm and then "console" works to open xterm.js. Thanks for that.
So the only way to get xterm.js to work is to have a popout window openned. the embedded console is not working with xterm.js as it is for ct / host.
 
Last edited:
I too am experiencing this. The default should be VNC for virtual machines and xterm for containers. This used to be the case prior to 8.
 
This is not for a specific vm, but it might be a starting point:
 
Same problem here. For the life of me, I cannot get the same xterm.js interface that I enjoy in LXC containers to work in my Debian VM.

Exact same symptoms as OP, I can only access it by manually choosing xterm.js in the dropdown and then at this point it launches an individual window.

I want it working INSIDE the Web Browser interface, in the left side Console tab. noVNC is atrocious. No copy paste functionality
 
What works is that:
Code:
1. Add a virtual serial port to the VM using PVE Web GUI and restart the VM

2. Enable and start the virtual serial port on VM, change tty number as needed (Reference: https://askubuntu.com/a/621209/838946)
$ sudo systemctl enable serial-getty@ttyS0.service
$ sudo systemctl start serial-getty@ttyS0.service

3. Done! You can now select xterm.js in the PVE Web GUI

from https://gist.github.com/xmesaj2/3ea1c35b5215d34a7c9e182c7486653f