mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 12:52:04 +00:00
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#59
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/60
Author: @JBailes
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @JBailes
Base:
main← Head:fix/host-network-lan-nic📝 Commits (1)
3912c2dfix(network): give --network=host containers a LAN NIC on PVE (#53)📊 Changes
5 files changed (+126 additions, -12 deletions)
View changed files
📝
deepdive.md(+4 -1)📝
internal/lxc/manager.go(+4 -6)📝
internal/lxc/network.go(+28 -0)➕
internal/lxc/network_test.go(+87 -0)📝
internal/lxc/pve_tarball.go(+3 -5)📄 Description
Addresses the remaining open item in #53 (the host-networking failure paulzzh reported) — issue stays open for confirmation on their setup.
Problem
A Wolf container started with
--network=hostcame up with no network configuration and no connectivity: the generated config had no NICs, and Wolf loggedmDNS error: Failed to open any client sockets.Root cause: a Proxmox CT cannot share the host's network namespace. The host-mode path emitted no
lxc.net.*and relied on omittingnetfromlxc.namespace.cloneto inherit the host netns — whichpctdoes not honor, leaving the container in an empty, unreachable namespace.The dual-NIC LAN mode already solves exactly this (a routable NIC on the physical bridge, where mDNS/Moonlight discovery and inbound traffic work), but it was gated behind a
gow.lan=truelabel that a vanilladocker run --network=host … wolfnever sets — so the feature existed but never triggered for the containers that need it.Fix
When a LAN bridge is configured (
--bridge), a--network=hostcontainer is automatically given the same dual-NIC LAN treatment instead of an unreachable namespace.internal/lxc/network.go— newapplyLANNetworking()helper consolidating the previously-duplicated LAN-fill logic; also converts host-mode → LAN NIC and clearsNetworkModeso no futile host-netnsnamespace.cloneis emitted.internal/lxc/manager.go+internal/lxc/pve_tarball.go— both PVE create paths (pct cloneandpct createfrom tarball, which Wolf uses) call the shared helper before IP allocation.internal/lxc/network_test.go— covers the host-mode conversion, explicit-label path, no-bridge no-op, and plain-bridge skip; asserts the generated config has the LAN NIC and nonamespace.clone.deepdive.md— documents the host-mode → LAN behavior.Notes / caveats
--bridgeis configured (which paulzzh did in their last comment, and which the docs already require for Moonlight/mDNS discovery). Without a bridge, host mode is unchanged — a CT genuinely can't do host networking, so there is nothing better to convert it to.<prefix>.<vmid>) rather than literally the host IP — consistent with the existing dual-NIC design.go build,go vet, andgo test ./...all pass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.