How to Solve an Error of Libvirt having problem in dnsmasq

Posted on

The problem specified in the title of this article is actually triggered by an error on starting libvirt daemon or service. The main problem is the libvirt daemon or service which is usually perform well suddenly generated an error after it is being restarted. The error itself doesn’t specifically point out the problem is actually in the dnsmasq configuration, but the error is shown as below :

root@hostname:/var/lib/libvirt# systemctl status libvirtd
● libvirt-bin.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirt-bin.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Fri 2018-05-11 14:16:09; 5min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
  Process: 3424 ExecStart=/usr/sbin/libvirtd $libvirtd_opts (code=exited, status=1/FAILURE)
 Main PID: 3424 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/libvirt-bin.service
           ├─12869 /usr/sbin/libvirtd -d -l
           ├─12976 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
           └─12977 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
May 11 14:21:01 hostname dnsmasq[12976]: using nameserver 8.8.8.8#53
May 11 14:21:01 hostname dnsmasq[12976]: using nameserver xxx.xxx.xxx.xxx#53
May 11 14:21:01 hostname dnsmasq[12976]: using nameserver fe80::1%wlp1s0#53
May 11 14:21:16 hostname dnsmasq[12976]: reading /etc/resolv.conf
May 11 14:21:16 hostname dnsmasq[12976]: using nameserver 8.8.8.8#53
May 11 14:21:16 hostname dnsmasq[12976]: using nameserver xxx.xxx.xxx.xxx#53
May 11 14:21:19 hostname dnsmasq[12976]: reading /etc/resolv.conf
May 11 14:21:19 hostname dnsmasq[12976]: using nameserver 8.8.8.8#53
May 11 14:21:19 hostname dnsmasq[12976]: using nameserver xxx.xxx.xxx.xxx#53
May 11 14:21:19 hostname dnsmasq[12976]: using nameserver 127.0.1.1#53
root@hostname:/var/lib/libvirt# 

Basically, I am using a specific configuration of the NetworkManager located in /etc/NetworkManager/NetworkManager.conf which exists in Ubuntu Linux distribution as shown below :

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false

The error is happened upon commenting the line of ‘dns=dnsmasq’. After that line is being commented, the error above occurred. The error itself is the error of the disfunctionality of libvirt. It happens of the NetworkManager is being restarted. So, the case of the error happened when libvirt starts using the configuration without the option of ‘dns=dnsmasq’ previewed in the above output error log. The option dnsmasq functions as a DNS relay which is might be the cause for libvirt to screw up whenever it starts without the option.

Since the main goal is to run libvirt service or daemon in local, just to test several image or instance to be loaded and fully running in local, other configuration created to make the web-based libvirt administration or webvirt to be accessed from another network is not necessary.

Leave a Reply