Skip to content

fix(qemu): pass detected bridge helper on single-queue NICs#45

Merged
Benehiko merged 1 commit into
mainfrom
fix/bridge-helper-single-queue
Jul 19, 2026
Merged

fix(qemu): pass detected bridge helper on single-queue NICs#45
Benehiko merged 1 commit into
mainfrom
fix/bridge-helper-single-queue

Conversation

@Benehiko

Copy link
Copy Markdown
Owner

Problem

Single-CPU VMs with bridge networking (e.g. the truenas template) fail to boot with:

qemu-system-x86_64: -nic bridge,br=br0,...: bridge helper failed

The managed vee-qemu bundle is built with a /usr/local prefix, so its compiled-in default helper path is /usr/local/libexec/qemu-bridge-helper, which rarely exists on real hosts. The config layer already probes common distro locations for a setuid qemu-bridge-helper (e.g. /usr/lib/qemu/qemu-bridge-helper on Arch), but the detected path was only applied on the multiqueue code path, which is gated on CPUs > 1. Single-queue bridge VMs emitted -nic bridge,br=... without helper= and hit the missing default.

Fix

  • internal/vm/manager.go: set nic.BridgeHelper for every bridge-mode VM when a helper is detected; multiqueue remains gated on CPUs > 1.
  • internal/qemu/nic.go: append helper= to the -nic shorthand when BridgeHelper is set.

Verification

  • go build / go test ./internal/qemu ./internal/vm / golangci-lint run all pass.
  • Reproduced on a host running the managed qemu-10.0.2-vee1 bundle: truenas (1 CPU, bridge br0) failed with "bridge helper failed"; with this fix it boots and stays running.

🤖 Generated with Claude Code

The managed vee-qemu bundle is built with a /usr/local prefix, so its
compiled-in default bridge helper path is
/usr/local/libexec/qemu-bridge-helper — a location that rarely exists on
real hosts. The config layer already probes common distro locations for
a setuid qemu-bridge-helper, but the detected path was only wired into
the multiqueue (-netdev tap) code path, which requires CPUs > 1.

Single-CPU bridge VMs used the -nic shorthand without helper=, so QEMU
fell back to the missing /usr/local path and failed with "bridge helper
failed" at boot.

Set NIC.BridgeHelper for every bridge-mode VM and append helper= to the
-nic shorthand when it is set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Benehiko
Benehiko merged commit a9aa602 into main Jul 19, 2026
4 checks passed
@Benehiko
Benehiko deleted the fix/bridge-helper-single-queue branch July 19, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant