On 26/06/16 02:37, David Sommerseth wrote: > On 24/06/16 16:48, Ken Teh wrote: >> I was trying to set up dnsmasq and discovered it's already running. >> Apparently as part of libvirt. Why is libvirt started? What starts it? >> >> I tried looking through systemd output but the only thing about systemd >> that I can understand are its services. Everything else is so far >> gobbledy-gook. > > libvirtd starts by default a virtual closed network (which is NATed) for > VMs. This is usually assigned an IP range in the 192.168.200.0/24 > range, IIRC. And it is only available for VMs running on the box, > started and configured by libvirt. And libvirtd uses dnsmasq for these > services. > > To stop it, run these commands as root: > > # virsh > virsh # net-list --all > Name State Autostart Persistent > ---------------------------------------------------------- > default inactive no yes > > virsh # net-destroy default > Network default destroyed > > virsh # > > > 'destroy' sounds harsh and brutal, but in libvirt lingo, it means "stop > running". > > To make this permanent, run this command in virsh > > virsh # net-autostart default --disable > Network default unmarked as autostarted > virsh # > > That's it. >
Oh, and I forgot the systemd dependency stuff. Try running this: # systemctl list-dependencies --reverse libvirtd I guess you'll see that it's just some graphical stuff needing it, most likely started if you're having a graphical console. The --reverse option should give an indication which other systemd unit files depends on libvirtd running. Removing --reverse should list all systemd units libvirtd needs to have running to be able to start. But you should be able to disable it: # systemctl disable libvirtd And if it still starts, you can enforce it to never be started: # systemctl mask libvirtd To reverse these opeartions, use 'enable' instead of 'disable' and 'unmask' instead of 'mask'. -- kind regards, David Sommerseth