Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMU VC (graphical terminal) fixes #4660

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

rouming
Copy link
Contributor

@rouming rouming commented Mar 5, 2025

Hey folks,

With this PR I brought a several upstream QEMU fixes, which target QEMU terminal (console-vc) bugs, making graphical console (e.g. VNC) more usable and aligning it better with VT100 spec. The updates include support for inserting and deleting characters, better cursor handling and correct position reporting.

The most annoying issue you can observe in the EVE VNC shim console, when the shell prompt always contains terminal escape symbols at the end, something like this:

      ~# ^[[20;1R

This is fixed by the following backported patch:
27-qemu--ui-console-vc-report-to-the-application-instead-of-s.patch

Summary of included patches:

  1. Handle ESC ( <ch> character set sequences

    • Makes top output look clean by handling the character set
      commands.
  2. Ensure DSR (Device Status Report) responses go to applications

    • Stops terminal from rendering responses to the screen but instead
      send reports back to applications.
  3. Fix cursor position reporting

    • Reports cursor position relative to the screen instead of the
      scroll buffer.
    • Fixes issues with tools that rely on accurate cursor placement.
  4. Support for DCH (delete) and ICH (insert) commands

    • Properly handles character deletion and insertion as per VT100
      specs.

This was tested using eden, the following docker image docker://lfedge/eden-eclient:b1c1de6 and latest EVE master.

Rise and shine, shim VM console. Rise and shine!

rouming added 2 commits March 5, 2025 10:10
This change brings several latest backported QEMU fixes, which target
QEMU terminal (console-vc) bugs, making graphical console (e.g. VNC)
more usable and aligning it better with VT100 spec. The updates
include support for inserting and deleting characters, better cursor
handling and correct position reporting.

One particularly annoying bug is that in the shim VNC console, the
shell prompt contains ESC symbols:

   ~# ^[[20;1R

This is fixed by the following backported patch:
   27-qemu--ui-console-vc-report-to-the-application-instead-of-s.patch

Summary of included patches:

1. Handle `ESC ( <ch>` character set sequences
  * Makes `top` output look clean by handling the character set
    commands.

2. Ensure DSR (Device Status Report) responses go to applications
  * Stops terminal from rendering responses to the screen but instead
    send reports back to applications.

3. Fix cursor position reporting
  * Reports cursor position relative to the screen instead of the
    scroll buffer.
  * Fixes issues with tools that rely on accurate cursor placement.

4. Support for DCH (delete) and ICH (insert) commands
  * Properly handles character deletion and insertion as per VT100
    specs.

Signed-off-by: Roman Penyaev <[email protected]>
Change the shim VM prompt from

  ~ #

to

  root@shim ~#

"Rise and shine, shim VM console. Rise and shine!"

Signed-off-by: Roman Penyaev <[email protected]>
Copy link
Contributor

@rene rene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rouming , LGTM

@eriknordmark eriknordmark merged commit d895f1f into lf-edge:master Mar 6, 2025
45 checks passed
@rouming rouming deleted the qemu-vc-fixes branch March 6, 2025 19:29
@naiming-zededa
Copy link
Contributor

Hey @rouming thanks. I'm also thinking we have this 'kubevirt' which uses k3s/kubevirt to launch the VM on EVE device, they call it VMI, the code for create vmi (a replicaSet config). we can use 'kubectl [vnc | console] ' to access the VMI VNC/console, but in the shim-VM for container inside, i'm not sure if there is way to pass in some 'console' or 'serial' type of config in their kubevirt API or yaml to replicate the similar thing for the 'shim-console' kind of mapping. Any idea? thanks.

@rouming
Copy link
Contributor Author

rouming commented Mar 10, 2025

Hi @naiming-zededa, I'm not an expert in kubevirt at all, but if this layer starts QEMU based VM, then it should not be a problem to have a similar thing by passing the correct config to the QEMU, but unfortunately I have no idea how this thing (kubevirt) works and what API does it support, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants