Remote App on Another PC
What You Will Learn
- Create a member-hub invitation that carries a remote-app grant (QarMemberHubInvitationAppGrantExt) on the primary hub's PC
- Carry it to the other PC over your application's own channel
- Join that PC's hub to the primary as a member (qar_runtime_join_hub_as_member)
- Onboard the app there as a local app, redeeming the grant (QarOnboardRemoteAppGrantExt), and later start it with nothing
When to Use It
Your application already spans two PCs (a simulation server on the QAROS PC and its clients on other PCs) and the part on the other PC should stream into the same QAROS session, without an operator walking over to pair it. The other PC needs QAROS installed; its hub becomes a member of the primary hub. Windows only.
An app cannot obtain a pairing code or an unbound invite for another PC: the grant is the only app-issued way in, and it admits exactly one app.
Build and Run
issue writes the invitation to stdout and refuses to print it on a console, so it never lands on screen or in a terminal log; its messages go to stderr. To try it out by hand, redirect it to a file you delete right after join read it.
Step 1: Issue the Invitation on the Primary's PC
What the primary hub checks:
- The calling process is an app it approved (the hub identifies it from Windows, as for a local app: Local App Onboarding). This example joins as a local app first so the user can approve it. Unknown: QAR_STATUS_ONBOARDING_APPROVAL_DENIED.
- The operator gave that approval the right to bring in member hubs, with quota left: otherwise QAR_STATUS_MEMBER_SPONSOR_NOT_ALLOWED or QAR_STATUS_MEMBER_SPONSOR_QUOTA_EXCEEDED.
- The hub on this PC is a primary, not a member itself (QAR_STATUS_SESSION_WIDE_ACTION_ON_MEMBER).
- The grant's tag follows the app tag rules (QAR_STATUS_ARGUMENT_NOT_SUPPORTED otherwise).
The invitation is signed by the primary hub, valid 24 h and for one hub by default (QarMemberHubInvitationInit), and listed in the primary's visualizer, where the operator can revoke it. It is a bearer secret: whoever holds it can join a hub until it expires or is used up. Send it only over an encrypted, authenticated channel, never log it, never put it on a command line.
Step 2: Join the Other PC's Hub as a Member
- This joins the hub of that PC, not the app. The call starts the installed hub when none runs, checks the invitation's signature and expiry, checks that this PC trusts the primary (an administrator's allow-list, else the primary this hub joined first), joins and waits through the hub's restart into the primary's session.
- Typical failures: QAR_STATUS_MEMBER_INVITATION_EXPIRED, _USED_UP, _REVOKED (ask for a new invitation), _PRIMARY_NOT_ALLOWED (this PC does not trust that primary), QAR_STATUS_PRIMARY_UNREACHABLE, QAR_STATUS_TIMEOUT (the join is committed; calling again succeeds once the hub is back).
- Called again for the primary it already belongs to, it succeeds at once.
Step 3: Onboard, Redeeming the Grant
- The first executable that redeems the grant is approved on the primary without a prompt and recorded by its publisher (signed) or file hash (unsigned). A different executable is refused afterwards (QAR_STATUS_ONBOARDING_APPROVAL_DENIED), also with a later invitation of the same app and tag.
- The primary picks the peer id and remembers it under the grant's tag; no QarOnboardLocalAppTagExt is needed.
- With a grant, the issuing app's own approval is not extended to the member hub: the grant admits this one app only.
Step 4: Every Later Start
A plain local onboard: the app is approved now, so no invitation and no prompt are needed, and the primary gives it the same peer id while no other live process holds it.
What Is Stored, and for How Long
- Either app: nothing; onboarding ids stay zero.
- The channel: the invitation, until used up or expired (default one hub, 24 h).
- The remote app's memory: key and a 30-minute certificate, renewed while it runs, as for any local app.
- The primary hub: the granted approval (until revoked) and the remembered peer id (until unused for 30 days).
Revoking the issuing app's approval, or the granted one, on the primary revokes the remote app and forgets its peer id.
Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.9.8.