Open Antoine-Gicquel opened 2 years ago
For now, I found a hacky workaround, setting net_device
like so :
net_device = "virtio-net,mac=00:00:00:00:00:00"
It uses builder/qemu/step_run.go, line 252, to inject the argument in the qemu-system command.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Description
It would be nice to make use of qemu's ability to set the mac address of a netdev. I think it would involve adding parameters in
builder/qemu/step_run.go
, and should be pretty straightforward. I currently am not skilled enough in Go / not familiar enough with the internals of Packer to feel confident about implementing this feature myself, but I would be pleased to help or to be guided at low level (like telling me which files to change precisely etc).Use Case(s)
I would need it in order to control which IP address is given to the guest VM on a bridge (using dnsmasq for DHCP).
Potential configuration
Potential References
Qemu documentation on setting a mac address with
-netdev
and-device
?