Skip to content

Conversation

@ekohl
Copy link
Member

@ekohl ekohl commented Oct 29, 2025

This sets up a DNS networking hook that reconfigures systemd-resolved to resolve the domain, if the libvirt network has one set. For that it also needs systemd-resolved to be installed.

Currently a draft to try out changes. If this works, #266 can proceed and in other places we can also avoid ugly hacks.

@ekohl ekohl force-pushed the set-up-dns branch 3 times, most recently from 72a1880 to bd2f893 Compare October 29, 2025 19:40
@ekohl
Copy link
Member Author

ekohl commented Oct 29, 2025

I get this error, but when I manually SSH in (as non-root) it doesn't show an error:

Network vagrant-libvirt defined from /dev/fd/63
error: Failed to start network vagrant-libvirt
error: error creating bridge interface virbr1: Operation not permitted

@ekohl
Copy link
Member Author

ekohl commented Oct 29, 2025

Connecting to qemu:///system worked so now it can ping quadlet.example.com via proper DNS. Obviously this PR right now is only a proof of concept, but I think it can easily be worked into a real thing.

Question is, where do we integrate this? voxpupuli/setup-vagrant?

@archanaserver
Copy link
Contributor

Connecting to qemu:///system worked so now it can ping quadlet.example.com via proper DNS. Obviously this PR right now is only a proof of concept, but I think it can easily be worked into a real thing.

Question is, where do we integrate this? voxpupuli/setup-vagrant?

Looking at it the DNS hook setup works nicely with systemd-resolved, and switching to qemu:///system fixes the bridge issue.
I was thinking it makes sense to move this into voxpupuli/setup-vagrant long term so other projects benefit too, maybe behind a flag like configure_libvirt_dns: true or libvirt_domain: example.com. Also would it make sense to log resolvectl status or virsh net-dumpxml in the workflow artifacts to help debug future DNS issues?

ekohl added 2 commits October 31, 2025 02:01
This makes sure the domain is set when the management domain is created,
which makes libvirt configure dnsmasq as a proper DNS server. This can
be used together with systemd-resolved on the host to look up guest IPs.
This sets up a DNS networking hook that reconfigures systemd-resolved to
resolve the domain, if the libvirt network has one set. For that it also
needs systemd-resolved to be installed.
@ekohl
Copy link
Member Author

ekohl commented Oct 31, 2025

This is now updated to set the management domain in Vagrantfile so you don't need to modify the network anymore. That makes it a fairly clean.

I've submitted it as voxpupuli/setup-vagrant#1. I've also learned systemd-resolved is present by default (at least in 24.04) so that can be skipped.

@ekohl ekohl closed this Nov 4, 2025
@ekohl ekohl deleted the set-up-dns branch November 4, 2025 18:13
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