mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-16 05:12:04 +00:00
[PR #18] [CLOSED] Move ephemeral CTs into the PVE VMID >= 10000 range #19
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/18
Author: @JBailes
Created: 4/18/2026
Status: ❌ Closed
Base:
docker-lxc-daemon← Head:fix/ephemeral-ct-vmid-range📝 Commits (2)
230adfcapi: advertise OSType + Builder-Version in /_ping8786034lxc: ephemeral containers become PVE CTs at VMID >= 10000📊 Changes
2 files changed (+80 additions, -95 deletions)
View changed files
📝
internal/api/system.go(+2 -0)📝
internal/lxc/manager.go(+78 -95)📄 Description
Summary
Two fixes, both from a debug session getting Wolf → Steam → Valheim working end-to-end on a Proxmox host via the daemon.
1.
/_pingadvertises OSType + Builder-VersionDocker CLI 26.x inspects the
/_pingHEAD response'sOSTypeheader before executing commands that touch host-path resources. Without the header, it rejecteddocker create --device /dev/dri/renderD128with:--network,--restart,--device-cgroup-rule, and even--deviceon simpler paths all worked — the gap only bit when a real device node was specified. SettingOSType: linux+Builder-Version: 1matches what upstream Docker emits and makes every affected command work without a client workaround.2. Ephemeral containers become PVE CTs at VMID ≥ 10000
Previously "ephemeral" meant a raw-LXC container living in
/var/lib/lxc/<id>/with a ZFS clone atlarge/lxc-<hash>— invisible to Proxmox tooling, and with unreliable networking because PVE enforces its own netns setup on CTs it knows about and ignoreslxc.*passthrough on ones it doesn't.docker run --network=hostproduced a container with no network interface at all.The GC also relied on a name-based "session vs support" heuristic (underscore in name = session, no underscore = support) and killed "orphaned support" containers whenever no "session" was running. A plainly-named
docker run --name wolf ...got GC'd as orphaned support ~9 seconds after launch, with its PulseAudio sidecar.New model: ephemeral containers are regular PVE CTs too, just allocated from a reserved high VMID range (≥ 10000) so operators can tell user workloads apart from daemon-managed ephemerals at a glance. Rule:
Changes
allocateEphemeralVMID()scans/etc/pve/lxc/*.confand returns the smallest free VMID at or aboveephemeralVMIDBase(10000).allocateVMID()(viapvesh nextid) stays for explicitly-requested permanent CTs (gow.pve=true).createEphemeralPVEnow usespct clone --full <template> <ephVMID> --storage <pool>, same shape ascreatePVEContainer. Rootfs at<pool>:subvol-<vmid>-disk-0; normal/etc/pve/lxc/<vmid>.confviawritePVEConfig.StartContainer/StopContainer/RemoveContainer/containerExists/reconcileflow through the existingpctpaths unchanged.gc()loses the session/support split and the orphan-kill logic. New body: skip permanent CTs (0 < VMID < ephemeralVMIDBase) and compose-managed, reap anything else in stateexited. Fixes the "Wolf got orphan-killed" regression.Test plan
docker run --name wolf ... ghcr.io/games-on-whales/wolf:stablecreates/etc/pve/lxc/10000.conf, boots, survives past the 30s GC tick, and stays up under--restart=unless-stopped.docker create --device /dev/dri/card0 ghcr.io/games-on-whales/wolf:stableno longer fails with "unknown server OS: .".🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.