Skip to content

Add Windows guest control and ConPTY - #431

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

Add Windows guest control and ConPTY#431
sjmiller609 wants to merge 14 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 initial terminal sizing
  • 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

The dedicated Windows guest-control KVM gate and full Linux, Darwin, and install suites pass. Runtime terminal resize and additional signal-parity work are intentionally deferred.


Note

High Risk
Touches guest exec protocol, Windows process/token handling, vsock transport, and instance readiness, so bugs can affect command isolation, desktop session access, and when Windows VMs become Running.

Overview
Windows guests now run the existing gRPC guest-agent over virtio-win VioSock as a LocalSystem service (hypeman-guest-agent.exe), instead of skipping the agent.

Exec gains an explicit session (system vs desktop). SYSTEM uses ConPTY for TTY; desktop launches into the active interactive session on winsta0\default and rejects ConPTY. Commands start suspended, join a kill-on-close Job Object, then resume so timeouts and RPC close kill the whole tree. Copy/stat/shutdown work on Windows; network reconfigure is unimplemented.

Host-side, Windows instances no longer force SkipGuestAgent. They become Running when a guest-agent probe succeeds (using cmd.exe instead of /bin/true). CI builds the Windows agent and adds a QEMU guest-control integration gate.

Reviewed by Cursor Bugbot for commit a0a4c9a. 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
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated
Comment thread lib/instances/windows_guest_agent_integration_linux_test.go Outdated
@sjmiller609
sjmiller609 force-pushed the hypeship/windows-guest-control branch from 1f60d0a to 95cf15f Compare August 21, 2026 15:28
Comment thread lib/instances/query.go

@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 1 potential issue.

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 a0a4c9a. Configure here.

})
require.NoError(t, err, stderr.String())
require.Equal(t, 0, exit.Code)
assert.Contains(t, stdout.String(), "HYPEMAN_DESKTOP_OK")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Desktop station check removed

Medium Severity

The desktop-session integration check now only asserts that a DESKTOP exec can echo output. It no longer verifies the process lands on WinSta0\Default, which is the defining property of desktop sessions for UI visibility. A regression that obtains a user token but fails to bind the interactive desktop would still pass this gate.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a0a4c9a. Configure here.

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