Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: specify helper to qemu #1421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NicGrimpe
Copy link

Description

Without this change I could not launch a vm with a network configured. network="br0"

failed to create tun device: Operation not permitted
qemu-system-x86_64: -nic bridge,br=br0,model=virtio-net-pci: bridge helper failed

Tested on nixos. Maybe there is a better way to get it to work, feel free to let me know and close this PR in that case :)

Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my code
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

@2b
Copy link

2b commented Oct 6, 2024

Hi! Thank you for the fix!

Maybe this should be fixed at the package.nix level, if it's NixOS-specific. What do you think?
In the meantime, here is a Nix overlay for anyone who stumbled upon this, like me:

final: prev: {
  quickemu = prev.quickemu.overrideAttrs (oldAttrs: {
    postPatch = (oldAttrs.postPatch or "") + ''
      substituteInPlace quickemu \
        --replace-fail 'args+=(-nic bridge,br=''${network},model=virtio-net-pci''${MAC})' \
                       'args+=(-nic bridge,br=''${network},helper=$(type -p qemu-bridge-helper),model=virtio-net-pci''${MAC})'
    '';
  });
}

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.

2 participants