Skip to content

Add Windows guest control and ConPTY - #431

Open
sjmiller609 wants to merge 20 commits into
hypeship/windows-imagesfrom
hypeship/windows-guest-control
Open

Add Windows guest control and ConPTY#431
sjmiller609 wants to merge 20 commits into
hypeship/windows-imagesfrom
hypeship/windows-guest-control

Conversation

@sjmiller609

@sjmiller609 sjmiller609 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

summary

  • cross-compile the guest agent as a Windows LocalSystem service
  • listen through the virtio-win VioSock provider while retaining the existing gRPC protocol
  • add SYSTEM and active-desktop execution sessions
  • add ConPTY terminal allocation and resize handling
  • support Windows file copy, stat, readiness, and graceful shutdown
  • bind command trees to kill-on-close Job Objects and terminate them synchronously
  • promote Windows instances to Running when guest-agent readiness is proven
  • move guest-service protocol and lifecycle rationale into lib/system/README.md

targeted tests

  • guest, guest-agent, and Windows readiness unit tests
  • Windows guest-agent cross-compilation

Additional terminal signal-parity work is intentionally deferred. Long-running KVM and full CI suites were not run for this review pass.


Note

High Risk
Touches guest command execution, Windows tokens/desktop sessions, and vsock transport—security-sensitive guest control with new process-lifetime semantics.

Overview
Windows VMs now run the same guest-agent protocol as Linux. The agent is cross-compiled as hypeman-guest-agent.exe, installed as the HypemanGuestAgent LocalSystem service, and listens on virtio-win VioSock (port 2222). Windows instances no longer skip the guest agent; readiness can mark them Running.

Exec gains an explicit session (system vs desktop). SYSTEM uses the service account; DESKTOP impersonates the active interactive user on winsta0\default. Interactive TTY uses ConPTY (SYSTEM only). Commands start suspended, join a kill-on-close Job Object, then resume so timeouts and RPC close tear down the whole process tree.

Copy/stat/shutdown work on Windows (ownership and network reconfigure are no-ops/unimplemented). The exec API defaults Windows shells to cmd.exe. CI builds the Windows agent and adds a QEMU guest-control integration gate.

Reviewed by Cursor Bugbot for commit 1f60d0a. Bugbot is set up for automated code reviews on this repo. Configure here.

@sjmiller609 sjmiller609 changed the title Add Windows guest control Add Windows guest control and ConPTY Aug 20, 2026
@socket-security

socket-security Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub.com/​aymanbagabas/​go-pty@​v0.2.2100100100100100

View full report

@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch 2 times, most recently from c5bc68c to 0d96de5 Compare August 20, 2026 14:14
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 0d96de5 to 73fd1af Compare August 20, 2026 15:42
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 73fd1af to 7cd7a6e Compare August 20, 2026 16:46
Comment thread docs/windows-guest-agent.md Outdated
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go
Comment thread lib/system/guest_agent/exec_session_windows.go
Comment thread lib/system/guest_agent/exec_tty_unix.go
Comment thread lib/system/guest_agent/listener_windows.go
Comment thread lib/system/guest_agent/listener_windows.go
Comment thread lib/system/guest_agent/process_job_windows.go
Comment thread go.mod
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 0c1d3e4 to 1487012 Compare August 20, 2026 18:29
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 1487012 to 96a8dd9 Compare August 20, 2026 20:25
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 96a8dd9 to 38cabf0 Compare August 20, 2026 23:41
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 38cabf0 to 0886125 Compare August 21, 2026 00:13
@sjmiller609
sjmiller609 marked this pull request as ready for review August 21, 2026 00:31
Comment thread lib/system/guest_agent/exec_tty_unix.go
Comment thread lib/system/guest_agent/exec_session_windows.go
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2dfae88. Configure here.

Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go
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