KVM + Xenial Server. libvirt-bin won't configure

6,265

Solution 1

This seems to be caused by apparmor as you will find something similar to this in your syslog:

kernel: [ 2386.130467] audit: type=1400 audit(1461767119.644:89): apparmor="DENIED" operation="create" profile="/usr/sbin/libvirtd" pid=21368 comm="libvirtd" family="netlink" sock_type="raw" protocol=0 requested_mask="create" denied_mask="create"

Until the bug is fixed, one insecure workaround is to temporarily disable apparmor for the installation:

sudo systemctl stop apparmor.service
sudo apt-get -f install
sudo systemctl start apparmor.service

Solution 2

Please don't uncomment this in /etc/libvirt/libvirtd.conf:

# You need to uncomment this line
log_outputs="3:syslog:libvirtd"

Leave it as the default like:

# You need to uncomment this line
#log_outputs="3:syslog:libvirtd"

It was referred to in the official libvirt wiki: http://wiki.libvirt.org/page/The_daemon_cannot_be_started, but it doesn't help at all.

The best option is to first run:

sudo systemctl stop apparmor.service
sudo apt-get -f install
sudo systemctl start apparmor.service

Then you can try:

systemctl status libvirt-bin.service

The output of which should be something like this:

libvirt-bin.service - Virtualization daemon

Loaded: loaded (/lib/systemd/system/libvirt-bin.service; enabled; vendor prese

Active: active (running) since Fr 2016-08-19 14:02:04 EST; 43s ago
Docs: man:libvirtd(8)
       http://libvirt.org

Main PID: 8620 (libvirtd)
CGroup: /system.slice/libvirt-bin.service
       ├─8620 /usr/sbin/libvirtd
       ├─9013 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.
       └─9014 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.
Share:
6,265

Related videos on Youtube

Justin
Author by

Justin

Updated on September 18, 2022

Comments

  • Justin
    Justin over 1 year

    I just (foolishly) completed the upgrade from 14.04.4 to 16.04. Apparently there's a bug due to the introduction of systemd that breaks libvirt... or I've broken aptitude. Is there a workaround or fix for this? Should I go back to 14.04?

    root@KVM0:~# apt-get install libvirt-bin
    Reading package 
    lists... Done
    Building dependency tree
    Reading state information... Done
    libvirt-bin is already the newest version (1.3.1-1ubuntu10).
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Setting up libvirt-bin (1.3.1-1ubuntu10) ...
    Job for libvirt-bin.service failed because the control process exited with error code. See "systemctl status libvirt-bin.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript libvirt-bin, action "start" failed.
    dpkg: error processing package libvirt-bin (--configure):
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     libvirt-bin
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
  • paddotk
    paddotk almost 7 years
    I get that output but after that there is a line in red: libvirtd[1008]: End of file while reading data: Input/output error