Skip to content

feat(vm): add VNC screenshot subresource#2641

Open
fl64 wants to merge 1 commit into
mainfrom
feat/vm/vnc-screenshot
Open

feat(vm): add VNC screenshot subresource#2641
fl64 wants to merge 1 commit into
mainfrom
feat/vm/vnc-screenshot

Conversation

@fl64

@fl64 fl64 commented Jul 10, 2026

Copy link
Copy Markdown
Member

Description

Adds a virtualmachines/screenshot subresource to the aggregated virtualization apiserver. It returns a PNG snapshot of the VM graphical console. Under the hood it proxies a plain GET to the KubeVirt vnc/screenshot endpoint (which already ships in our virt-api), so no node-side changes are required. The moveCursor query parameter is supported to wake a blanked screen before the frame is captured.

Why do we need it, and what problem does it solve?

There was no way to grab a still image of a VM screen through the platform API — users had to open an interactive VNC session just to see the current display state. A screenshot subresource lets tools and UIs fetch the current screen as an image (e.g. to show a VM preview or to diagnose a VM that is stuck at a boot/login screen) without a full VNC session.

What is the expected result?

On a running VM:

GET /apis/subresources.virtualization.deckhouse.io/v1alpha2/namespaces/<ns>/virtualmachines/<name>/screenshot

returns Content-Type: image/png with the current screen. Adding ?moveCursor=true nudges the pointer first so a blanked display wakes up. Access is granted by the existing access_remote_display use-capability.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vm
type: feature
summary: "Added a screenshot subresource that returns a PNG image of the VM screen."

Add virtualmachines/screenshot subresource to the aggregated apiserver.
It proxies a plain GET to the kubevirt vnc/screenshot endpoint and returns
an image/png of the VM console. Supports the moveCursor query parameter.

Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
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.

1 participant