Research: LXC path (Proxmox API vs liblxc, and LXD/Incus) #30

Open
opened 2026-09-24 08:40:04 +00:00 by kayg · 6 comments
Owner

DECISIONS Open item 3: "LXC path: Proxmox API first, or plain liblxc", plus item 4, whether LXD/Incus virtual machines appear. The owner asked when full LXC support arrives, so this needs a cited recommendation for the owner to decide on.

DECISIONS Open item 3: "LXC path: Proxmox API first, or plain liblxc", plus item 4, whether LXD/Incus virtual machines appear. The owner asked when full LXC support arrives, so this needs a cited recommendation for the owner to decide on.
Author
Owner

Starting research for kayg/infraternal#30 on branch research-lxc, based on dev head 9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a. Scope is only docs/research/lxc.md; I will not push.

Starting research for kayg/infraternal#30 on branch `research-lxc`, based on `dev` head `9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a`. Scope is only `docs/research/lxc.md`; I will not push.
Author
Owner

Finding for #30: PVE-managed LXC has no arbitrary command-execution REST endpoint in the published API; pct exec is a local host command, while LXC console access uses termproxy followed by vncwebsocket. The API's guest-agent exec routes are for QEMU VMs. Proxmox's late-2025 development series added token authentication to the terminal proxy flow, so the adapter should test the exact installed PVE release before advertising the exec channel. Sources: https://pve.proxmox.com/pve-docs/api-viewer/ ; https://pve.proxmox.com/pve-docs-9-beta/pct.1.html ; https://lore.proxmox.com/pve-devel/fec81bb3-ed78-46c7-b6f0-bd899ae8da5f%40proxmox.com/t/

Finding for #30: PVE-managed LXC has no arbitrary command-execution REST endpoint in the published API; `pct exec` is a local host command, while LXC console access uses `termproxy` followed by `vncwebsocket`. The API's guest-agent `exec` routes are for QEMU VMs. Proxmox's late-2025 development series added token authentication to the terminal proxy flow, so the adapter should test the exact installed PVE release before advertising the `exec` channel. Sources: https://pve.proxmox.com/pve-docs/api-viewer/ ; https://pve.proxmox.com/pve-docs-9-beta/pct.1.html ; https://lore.proxmox.com/pve-devel/fec81bb3-ed78-46c7-b6f0-bd899ae8da5f%40proxmox.com/t/
Author
Owner

Compatibility finding for #30: Debian 13 stable currently packages LXC 6.0.4, while upstream LXC 7.0 LTS is a separate release line supported through June 2031. The Debian 13 real-engine gate should claim 6.0.4 coverage; add a separate 7.0 test before claiming upstream 7.0 support. Sources: https://packages.debian.org/trixie/lxc and https://linuxcontainers.org/lxc/news/

Compatibility finding for #30: Debian 13 stable currently packages LXC 6.0.4, while upstream LXC 7.0 LTS is a separate release line supported through June 2031. The Debian 13 real-engine gate should claim 6.0.4 coverage; add a separate 7.0 test before claiming upstream 7.0 support. Sources: https://packages.debian.org/trixie/lxc and https://linuxcontainers.org/lxc/news/
Author
Owner

Read-only independent review started for #30. Worktree: /home/kayg/wt/research-lxc, branch: research-lxc, base/head: 9688a2438a. Scope: review docs/research/lxc.md for source-backed factual accuracy and fit with the repo contract. No edits, product code, tests or push.

Read-only independent review started for #30. Worktree: /home/kayg/wt/research-lxc, branch: research-lxc, base/head: 9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a. Scope: review docs/research/lxc.md for source-backed factual accuracy and fit with the repo contract. No edits, product code, tests or push.
Author
Owner

Independent review of docs/research/lxc.md: 3 findings (2 concrete gaps, 1 implementation risk). The requested date-sensitive version and release claims were consistent with the primary sources checked: PVE 9.2 release, Debian 13 LXC package, LXC releases, Incus releases, and LXD release policy.

  1. Medium — Stats mappings exceed the current Engine surface (lines 17–20, 33, 50, 62). The document marks PVE stats as supported and plans Incus/LXD/LXC stats through the JSON-lines channel, while line 3 says the recommendation follows the existing Engine capability model. The stream contract defines the stats payload shape, but the current Engine trait and Capabilities have no stats method or capability (stream contract). This makes the capability mapping and effort estimate depend on an unstated Engine API change. Mark stats as requiring that API/capability work, or describe an explicit extension to the current interface.

  2. Medium — PVE terminal protocol omits its authentication handshake (lines 9, 17; effort line 65). The description covers the termproxy port/ticket and data/resize framing, but leaves out the initial WebSocket protocol message carrying username:ticket\n and the server’s OK reply before terminal frames. Proxmox’s termproxy implementation implements this handshake. Without it, the proposed bridge description is incomplete for establishing the console, including the token-auth compatibility work mentioned at line 36.

  3. Risk — Plain LXC PTY setup is underspecified (lines 7, 18, 42, 61). The LXC manual says lxc-attach automatically allocates a PTY when an attached standard descriptor is already a terminal; a daemon’s stream-backed stdio may not meet that condition (lxc-attach manual). The claim is feasible, but the adapter needs an explicit host-side PTY allocation and byte/resize/exit bridge (or a defined liblxc FD strategy) to satisfy the existing argv and PTY Engine contract. The research should make that dependency visible in the recommendation and estimate.

Review only; no tests or verification gate run.

Independent review of `docs/research/lxc.md`: **3 findings** (2 concrete gaps, 1 implementation risk). The requested date-sensitive version and release claims were consistent with the primary sources checked: [PVE 9.2 release](https://www.proxmox.com/en/about/company-details/press-releases/proxmox-virtual-environment-9-2), [Debian 13 LXC package](https://packages.debian.org/trixie/lxc), [LXC releases](https://linuxcontainers.org/lxc/news/), [Incus releases](https://linuxcontainers.org/incus/news/), and [LXD release policy](https://canonical.com/lxd/docs/latest/reference/releases-snap/). 1. **Medium — Stats mappings exceed the current Engine surface (lines 17–20, 33, 50, 62).** The document marks PVE stats as supported and plans Incus/LXD/LXC stats through the JSON-lines channel, while line 3 says the recommendation follows the existing Engine capability model. The stream contract defines the stats payload shape, but the current [Engine trait](https://git.kayg.org/kayg/infraternal/src/commit/9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a/crates/engine/src/lib.rs#L56-L85) and [Capabilities](https://git.kayg.org/kayg/infraternal/src/commit/9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a/crates/engine/src/lib.rs#L123-L144) have no stats method or capability ([stream contract](https://git.kayg.org/kayg/infraternal/src/commit/9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a/docs/contracts.md#L812-L839)). This makes the capability mapping and effort estimate depend on an unstated Engine API change. Mark stats as requiring that API/capability work, or describe an explicit extension to the current interface. 2. **Medium — PVE terminal protocol omits its authentication handshake (lines 9, 17; effort line 65).** The description covers the termproxy port/ticket and data/resize framing, but leaves out the initial WebSocket protocol message carrying `username:ticket\n` and the server’s `OK` reply before terminal frames. Proxmox’s [termproxy implementation](https://github.com/proxmox/pve-xtermjs/blob/master/termproxy/src/main.rs) implements this handshake. Without it, the proposed bridge description is incomplete for establishing the console, including the token-auth compatibility work mentioned at line 36. 3. **Risk — Plain LXC PTY setup is underspecified (lines 7, 18, 42, 61).** The LXC manual says `lxc-attach` automatically allocates a PTY when an attached standard descriptor is already a terminal; a daemon’s stream-backed stdio may not meet that condition ([`lxc-attach` manual](https://linuxcontainers.org/lxc/manpages/man1/lxc-attach.1.html)). The claim is feasible, but the adapter needs an explicit host-side PTY allocation and byte/resize/exit bridge (or a defined liblxc FD strategy) to satisfy the existing [argv and PTY Engine contract](https://git.kayg.org/kayg/infraternal/src/commit/9688a2438a1c5bbeeb3326a5be8df58e5c4f9a0a/crates/engine/src/lib.rs#L463-L477). The research should make that dependency visible in the recommendation and estimate. Review only; no tests or verification gate run.
Author
Owner

Finished the LXC management research in docs/research/lxc.md (checked 2026-09-24; sources cited in the document).

Recommendation: build a plain LXC adapter first for an explicitly configured path not owned by another control plane. Keep Proxmox VE separate because its LXC API offers a console but no argv exec route; a shared Incus/LXD REST and WebSocket core is practical with per-server extension checks.

The report records two implementation dependencies: plain LXC needs an explicit host PTY bridge for stream-backed exec, and native stats require adding a stats method/capability and stream path to the current Engine interface. It also documents the PVE terminal WebSocket auth exchange and test/version risks.

Commit: ced3b80560291df38b78ee5c105c0082967c7274 (docs: research LXC management adapters). No push.

scripts/verify fast passed (run before final documentation-only refinements):

PASS fast: migrations are append-only
PASS fast: JavaScript dependencies
PASS fast: build web app
PASS fast: cargo fmt --check
PASS fast: cargo clippy
PASS fast: cargo test
PASS fast: svelte-check
PASS fast: UI package svelte-check
PASS fast: stream package typecheck
PASS fast: Vitest
PASS fast: UI package Vitest
PASS fast: stream package Vitest
PASS fast: OpenAPI and TypeScript client drift
PASS fast: terminal TypeScript
PASS fast: terminal Vitest

Finished the LXC management research in `docs/research/lxc.md` (checked 2026-09-24; sources cited in the document). Recommendation: build a plain LXC adapter first for an explicitly configured path not owned by another control plane. Keep Proxmox VE separate because its LXC API offers a console but no argv exec route; a shared Incus/LXD REST and WebSocket core is practical with per-server extension checks. The report records two implementation dependencies: plain LXC needs an explicit host PTY bridge for stream-backed exec, and native stats require adding a stats method/capability and stream path to the current Engine interface. It also documents the PVE terminal WebSocket auth exchange and test/version risks. Commit: `ced3b80560291df38b78ee5c105c0082967c7274` (`docs: research LXC management adapters`). No push. `scripts/verify fast` passed (run before final documentation-only refinements): > PASS fast: migrations are append-only > PASS fast: JavaScript dependencies > PASS fast: build web app > PASS fast: cargo fmt --check > PASS fast: cargo clippy > PASS fast: cargo test > PASS fast: svelte-check > PASS fast: UI package svelte-check > PASS fast: stream package typecheck > PASS fast: Vitest > PASS fast: UI package Vitest > PASS fast: stream package Vitest > PASS fast: OpenAPI and TypeScript client drift > PASS fast: terminal TypeScript > PASS fast: terminal Vitest
kayg referenced this issue from a commit 2026-09-24 12:58:22 +00:00
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal-v0#30
No description provided.