packages dnsmasq and libvirt-bin conflict with each other
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnsmasq (Ubuntu) |
Invalid
|
Low
|
Unassigned | ||
Precise |
Invalid
|
Undecided
|
Unassigned | ||
libvirt (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
============ SRU justification ===========
Impact: libvirt fails to bring up virbr0 when dnsmasq is installed
Development fix: install a dnsmasq.d file to prevent the system-wide dnsmasq
from binding to virbr0.
Stable fix: same as Development fix
Test case:
virsh net-destroy virbr0 || true
sudo apt-get purge libvirt-bin
sudo apt-get -y install dnsmasq
sudo apt-get -y install libvirt-bin
Regression potential: There should be none, since we are simply telling the
system-wide dnsmasq (if any) not to bind to the virbr0 which our own dnsmasq
instance will bind to.
=======
Binary package hint: libvirt-bin
1. Release:
Description: Ubuntu 8.04
Release: 8.04
2. Policies:
libvirt-bin:
Installed: 0.4.0-2ubuntu8
Candidate: 0.4.0-2ubuntu8
Version table:
*** 0.4.0-2ubuntu8 0
500 http://
100 /var/lib/
dnsmasq:
Installed: 2.41-2ubuntu1
Candidate: 2.41-2ubuntu1
Version table:
*** 2.41-2ubuntu1 0
500 http://
100 /var/lib/
3. Expected behavior: I expected the dnsmasq package not to interfere with the running of libvirt-bin.
4. Actual behavior: What happened is that libvirt-bin became unable to provide DHCP services to guest OSes running in a kvm virtual machine.
This is what I see in /var/log/syslog when libvirt-bin is able to start a virtual machine normally:
May 16 08:25:57 bodhi avahi-daemon[5446]: Joining mDNS multicast group on interface vnet0.IPv4 with address 192.168.122.1.
May 16 08:25:57 bodhi avahi-daemon[5446]: New relevant interface vnet0.IPv4 for mDNS.
May 16 08:25:57 bodhi avahi-daemon[5446]: Registering new address record for 192.168.122.1 on vnet0.IPv4.
May 16 08:25:57 bodhi dnsmasq[19217]: started, version 2.41 cachesize 150
May 16 08:25:57 bodhi dnsmasq[19217]: compile time options: IPv6 GNU-getopt no-ISC-leasefile DBus I18N TFTP
May 16 08:25:57 bodhi dnsmasq[19217]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
May 16 08:25:57 bodhi dnsmasq[19217]: reading /etc/resolv.conf
May 16 08:25:57 bodhi dnsmasq[19217]: using nameserver 192.168.2.1#53
May 16 08:25:57 bodhi dnsmasq[19217]: read /etc/hosts - 9 addresses
This is what I see when dnsmasq is installed:
May 16 08:16:55 bodhi dnsmasq[18482]: failed to bind listening socket for 192.168.122.1: Address already in use
May 16 08:16:55 bodhi dnsmasq[18482]: FAILED to start up
Observations and workaround:
1. It is possible to restore normal functioning while keeping both packages installed:
$ sudo /etc/init.d/dnsmasq stop
After this, libvirt-bin will work properly. However this is obviously not a permanent solution. If dnsmasq is not required to be present on the machine, then the package can be removed and libvirt-bin functionality will be restored (until something else breaks it).
2. It seems the problem is that dnsmasq is started by the OS when booting and then libvirt-bin tries to start it again for its own purposes.
3. I do not know what the proper fix is. Is it stupid to want both dnsmasq and libvirt-bin installed at the same time on the same system? Must libvirt-bin be fixed to handle this situation? I don't know. I installed dnsmasq based on a suggestion that dnsmasq was required for libvirt to provide DHCP services to guest OSes but apparently only dnsmasq-base is required for that. So the information I got was erroneous but it does not change the fact that the current packaging specs do not prevent users from shooting themselves in the foot.
Changed in dnsmasq (Ubuntu): | |
assignee: | Emmet Hikory (persia) → nobody |
Changed in libvirt (Ubuntu): | |
assignee: | Emmet Hikory (persia) → nobody |
Changed in dnsmasq (Ubuntu): | |
status: | In Progress → Confirmed |
Changed in libvirt (Ubuntu): | |
status: | In Progress → Confirmed |
Changed in dnsmasq (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in dnsmasq (Ubuntu): | |
status: | Fix Released → Confirmed |
Changed in dnsmasq (Ubuntu Precise): | |
status: | New → Invalid |
Changed in dnsmasq (Ubuntu): | |
status: | Confirmed → Invalid |
I suppose the problem is this :
libvirt provides DHCP service on the host virtual interface (vnet0...) so that guest VMs can get an address. dnsmasq, by default, listens to all available interfaces, so that includes vnet0. Obviously they conflict by both trying to provide the same service on the same interface.
Please test one of the following workarounds:
Enable the following line in /etc/dnsmasq.conf (supposing eth0 is the interfaces you want to use dnsmasq on):
interface=eth0
Alternatively, enable this line in /etc/dnsmasq.conf (supposing vnet0 is the interface you don't want dnsmasq to perturb): interface= vnet0
except-
This should allow dnsmasq and libvirt-bin to run side by side.