Skip to content

Add VNC snapshot recording#238

Open
fkorotkov wants to merge 2 commits into
mainfrom
dev-fkorotkov-vnc-recording
Open

Add VNC snapshot recording#238
fkorotkov wants to merge 2 commits into
mainfrom
dev-fkorotkov-vnc-recording

Conversation

@fkorotkov

Copy link
Copy Markdown
Contributor

Summary

  • add vnc_recording_dir and vnc_recording_interval builder options
  • connect to Tart's --vnc-experimental server for recording even without boot_command
  • record timestamped PNG snapshots only when the framebuffer changes and clear the output directory at recording start

Tests

  • git diff --check
  • GOCACHE=/private/tmp/packer-plugin-tart-gocache GOMODCACHE=/private/tmp/packer-plugin-tart-gomodcache go test ./builder/tart -run 'Test(PrepareVNCRecording|VNCFrameBuffer|VNCRecorder|HashFrame)' -count=1
  • GOCACHE=/private/tmp/packer-plugin-tart-gocache GOMODCACHE=/private/tmp/packer-plugin-tart-gomodcache go test ./... -run '^$' -count=1

@fkorotkov fkorotkov requested a review from edi-oai June 13, 2026 17:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b77e8cedb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread builder/tart/step_run.go
vncSession = vncConnection.session

if config.VNCRecordingDir != "" {
if !startVNCRecording(ctx, state, config, ui, vncSession) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Serialize VNC writes while recording boot commands

When both vnc_recording_dir and boot_command are set, this starts the recorder goroutine on the same vncSession before typeBootCommandOverVNC sends keys. The recorder periodically calls FramebufferUpdateRequest while bootcommand.NewVNCDriver writes key events to the same go-vnc ClientConn; go-vnc's KeyEvent emits one VNC message through several writes, so a recording request can interleave mid-key event and corrupt the VNC protocol stream. Please guard all ClientConn writes with a shared mutex or use a separate VNC connection for recording.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the bot is right here. If we're recording off of the VNC stream in real-time, we probably need to factor this out and share the resulting FB with the detection and recording.

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.

2 participants