Skip to content

feat(agent): connect to Windows Sandbox named pipes - #1580

Merged
Marc-André Moreau (mamoreau-devolutions) merged 8 commits into
masterfrom
copilot/windows-sandbox-ironrdp
Aug 8, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 8 commits into
masterfrom
copilot/windows-sandbox-ironrdp

Conversation

@mamoreau-devolutions

@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Windows Sandbox's default attach path is a local named pipe carrying plain TPKT/X.224 with PROTOCOL_RDP and ENCRYPTION_LEVEL_NONE, not TCP:3389 or VMConnect. Allow the connector and client to complete that sequence only via an explicit opt-in (enable_standard_rdp_security; NamedPipe enables it), and teach ironrdp-agent to resolve pipe path and guest credentials from WindowsSandboxServer after wsb start.

Adds Transport::NamedPipe, ironrdp_named_pipe/ironrdp_sandbox_id properties, sandbox list/config/stop CLI helpers via an in-process h2/gRPC client on the per-user \\.\pipe\wsandbox\{guid} pipe (no .NET helper), and connect --sandbox-id / --sandbox-pipe. Sandbox-derived properties are the merge base; explicit .rdp/--prop/flags override them while NamedPipe TLS/CredSSP stay forced off. Local :2179+PCB remains unsupported.

Windows Sandbox's default attach path is a local named pipe carrying plain TPKT/X.224 with PROTOCOL_RDP and ENCRYPTION_LEVEL_NONE, not TCP:3389 or VMConnect. Allow the connector and client to complete that sequence, and teach ironrdp-agent to resolve pipe path and guest credentials from WindowsSandboxServer after `wsb start`.

Adds Transport::NamedPipe, ironrdp_named_pipe/ironrdp_sandbox_id properties, sandbox list/config/stop CLI helpers (via a small .NET gRPC tool), and connect --sandbox-id / --sandbox-pipe. Local :2179+PCB remains unsupported.
Copilot AI balanced review requested due to automatic review settings August 7, 2026 19:43
@mamoreau-devolutions

Marc-André Moreau (mamoreau-devolutions) commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation notes (not part of squash message)

Live e2e (Windows 11 host, Sandbox feature on)

  1. wsb start (headless / --raw as available) → SandboxId printed
  2. ironrdp-agent sandbox list / sandbox config <id> via in-process gRPC against \\.\pipe\wsandbox\<md5(SID) as .NET Guid>
  3. ironrdp-agent connect --sandbox-id … opened \\.\pipe\{VMId}, completed PROTOCOL_RDP + MCS ENCRYPTION_LEVEL_NONE, session 1280×720 with desktop bitmap frames

Protocol findings

  • Default product path is NamedPipe, not TCP:3389 and not VMConnect :2179
  • X.224 with SSL/HYBRID only → failure 0x2; empty PROTOCOL_RDP accepted
  • No Security Exchange / no RC4 on Sandbox NamedPipe
  • Guest account is typically WDAGUtilityAccount + server-provisioned password from GetRdpClientConfig

Dependencies / limits

  • No .NET helper: agent speaks sandboxserver.SandboxCore in-process (h2 over the per-user pipe)
  • RdpTransport.Local (127.0.0.1:2179 + PCB) is intentionally rejected with a clear error for now; VMConnect work in feat(connector): Hyper-V vmconnect support #1503 is complementary but not wired as the Sandbox default path

@github-actions github-actions Bot added the needs-review A human reviewer is the current next actor label Aug 7, 2026
@github-actions github-actions Bot added risk/unknown Risk could not be determined automatically; needs maintainer-level scrutiny scope/core Touches the core architectural tier size/XL Size: up to 1299 counted lines and 49 files; exceeds L in either measure labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This pull request is size/XL, so automated review is disabled for it: a change this large is hard to review well in one piece, whether by a human or a model.

Please split it into focused pull requests that can each be reviewed on their own. When the parts build on each other, stacked pull requests let you open each one on top of the last without waiting for the one below to merge. Stacks require every branch to live in this repository, so from a fork, please open separate pull requests instead.

Automated review resumes once the change is below the size/XL threshold.

Copilot AI left a comment

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.

Pull request overview

Adds Windows Sandbox connectivity over named pipes with standard unencrypted RDP security.

Changes:

  • Adds named-pipe transport and PROTOCOL_RDP support.
  • Resolves Sandbox connection details through a .NET gRPC helper.
  • Adds Sandbox lifecycle and connection CLI commands.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
crates/ironrdp-connector/src/connection.rs Enables standard RDP security negotiation.
crates/ironrdp-client/src/rdp.rs Connects and finalizes named-pipe sessions.
crates/ironrdp-client/src/config.rs Adds named-pipe transport configuration.
crates/ironrdp-cfg/src/lib.rs Adds Sandbox property accessors.
crates/ironrdp-agent/tools/windows_sandbox_grpc.cs Implements the Sandbox gRPC helper.
crates/ironrdp-agent/src/sandbox.rs Resolves Sandbox properties and credentials.
crates/ironrdp-agent/src/lib.rs Exposes the Windows Sandbox module.
crates/ironrdp-agent/src/cli.rs Adds Sandbox CLI operations.
crates/ironrdp-agent/README.md Documents Sandbox usage.
crates/ironrdp-agent/Cargo.toml Adds Serde derive support.
Cargo.lock Records the dependency update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/ironrdp-client/src/config.rs Resolved
Comment thread crates/ironrdp-agent/src/sandbox.rs Resolved
Comment thread crates/ironrdp-agent/src/cli.rs Resolved
Comment thread crates/ironrdp-client/src/rdp.rs Resolved
Comment thread crates/ironrdp-agent/src/cli.rs Resolved
ActiveX must exhaustively match Transport::NamedPipe and reject it at
RPC connect time. Drop unused sandbox helper helpers that required bare
allow attributes, and gate ConfigBuilder mutability on vmconnect.
@github-actions github-actions Bot added the scope/ffi Affects native or .NET bindings label Aug 7, 2026
PROTOCOL_RDP with ENCRYPTION_LEVEL_NONE is only safe on trusted local
transports. Require enable_standard_rdp_security (NamedPipe opts in) so
disable-TLS/CredSSP cannot open a plaintext TCP session by accident.

Also start sandbox connect merges from sandbox defaults (user overrides
on top, NamedPipe security reasserted), discover the gRPC helper via
env/beside-exe/manifest/embedded source, and document sandbox ops in
AGENT_GUIDE.
@github-actions github-actions Bot added the scope/web Affects the web/WASM ecosystem label Aug 7, 2026
Speak WindowsSandboxServer over the per-user named pipe with an
in-process h2/gRPC client so list/config/stop and connect --sandbox-id
no longer need the .NET SDK or an embedded C# helper.
Only force TLS/CredSSP off after sandbox property merge when
ironrdp_named_pipe is set, so a Sandbox TCP config keeps CredSSP.
Return an error from ActiveX transport mapping instead of falling back
to Direct, and lock the SandboxCore pipe path with a live SID golden test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review A human reviewer is the current next actor risk/unknown Risk could not be determined automatically; needs maintainer-level scrutiny scope/core Touches the core architectural tier scope/ffi Affects native or .NET bindings scope/web Affects the web/WASM ecosystem size/XL Size: up to 1299 counted lines and 49 files; exceeds L in either measure

Development

Successfully merging this pull request may close these issues.

2 participants