** Description changed: [ Impact ] - * Lubuntu is unable to install virt-manager in a nested testing + * Lubuntu is unable to install virt-manager in a nested testing environment, due to a failure to install/configure libvirt-daemon- driver-qemu. - * Actually, this happens in any nested libvirt environment, where the + * Actually, this happens in any nested libvirt environment, where the default IP "192.168.122.1" is already assigned. - * There seems to be an ordering issue of virt-manager depends, as + * There seems to be an ordering issue of virt-manager depends, as libvirt-daemon-driver-qemu postinst depends on data from libvirt-daemon- config-network postinst but is not specifically declared as such. - * We need to modify libvirt's d/control, adding a "Pre-Depends: - libvirt-daemon-config-network" to the libvirt-daemon-driver-qemu binary. - This will automatically pull in libvirt-daemon-driver-network, creating - "/etc/libvirt/qemu/networks/autostart". It needs to be a Pre-Depends, as - the file "/etc/libvirt/qemu/networks/default.xml" is only created from - the "/usr/share/libvirt/networks/default.xml" template in libvirt- - daemon-config-network.postinst, i.e. after package configuration. + * We need to modify libvirt's d/control, adding a "Depends: libvirt- + daemon-config-network" to the libvirt-daemon-driver-qemu binary. This + will automatically pull in libvirt-daemon-driver-network, creating + "/etc/libvirt/qemu/networks/autostart". The file + "/etc/libvirt/qemu/networks/default.xml" is created from the + "/usr/share/libvirt/networks/default.xml" template in libvirt-daemon- + config-network.postinst, i.e. after package configuration (maintainer + scripts have executed). [ Test Plan ] $ lxc launch ubuntu-daily:plucky pprc $ lxc shell pprc # apt update # apt install libvirt-daemon-driver-qemu [...] Setting up libvirt-daemon-driver-qemu (11.0.0-2ubuntu6) ... useradd warning: libvirt-qemu's uid 64055 is greater than SYS_UID_MAX 999 fatal: The group `libvirt' does not exist. Enabling libvirt default network ln: failed to create symbolic link '/etc/libvirt/qemu/networks/autostart/': No such file or directory dpkg: error processing package libvirt-daemon-driver-qemu (--configure): installed libvirt-daemon-driver-qemu package post-installation script subprocess returned error exit status 1 dmesg: read kernel buffer failed: Operation not permitted [...] Errors were encountered while processing: libvirt-daemon-driver-qemu needrestart is being skipped since dpkg has failed Error: Sub-process /usr/bin/dpkg returned an error code (1) => The '/etc/libvirt/qemu/networks/autostart/' is assumed to exist by libvirt-daemon-driver-qemu.postinst but it's not there. It's supposed to be installed by d/libvirt-daemon-driver-network.dirs. # ll /etc/libvirt/qemu/networks/autostart ls: cannot access '/etc/libvirt/qemu/networks/autostart': No such file or directory # apt install libvirt-daemon-driver-network [...] # ll /etc/libvirt/qemu/networks/autostart total 8 drwxr-xr-x 2 root root 4096 Apr 16 08:12 ./ drwxr-xr-x 3 root root 4096 Apr 16 08:12 ../ lrwxrwxrwx 1 root root 38 Apr 16 08:12 default.xml -> /etc/libvirt/qemu/networks/default.xml ## ATTENTION: This is a broken/dangling symlink => Alright, looking OK. But now there can be another issue when libvirt- daemon-driver-qemu.postinst tries to assign an alternative IP address range, because the default 192.168.122.1/24 is already taken, e.g. in nested environments. We can easily simulate that by assigning the 192.168.122.1 IP to eth0: # ip addr add 192.168.122.1 dev eth0 ## This would also happen if we're in a nested environment # apt purge libvirt-daemon-driver-qemu # apt install --reinstall libvirt-daemon-driver-qemu [...] Setting up libvirt-daemon-driver-qemu (11.0.0-2ubuntu6) ... useradd warning: libvirt-qemu's uid 64055 is greater than SYS_UID_MAX 999 Default libvirt network on 192.168.122.1/24 already taken Changing to free 192.168.123.1/24 sed: can't read /etc/libvirt/qemu/networks/default.xml: No such file or directory dpkg: error processing package libvirt-daemon-driver-qemu (--configure): installed libvirt-daemon-driver-qemu package post-installation script subprocess returned error exit status 2 Processing triggers for man-db (2.13.0-1) ... Errors were encountered while processing: libvirt-daemon-driver-qemu needrestart is being skipped since dpkg has failed Error: Sub-process /usr/bin/dpkg returned an error code (1) => libvirt-daemon-driver-qemu.postinst tries to manipulate /etc/libvirt/qemu/networks/default.xml (using "sed") which is not there. The file is created by "d/libvirt-daemon-config-network.postinst" from the /usr/share/libvirt/networks/default.xml template: $ apt-file find networks/default.xml libvirt-daemon-config-network: /usr/share/libvirt/networks/default.xml # apt install libvirt-daemon-config-network [...] Setting up libvirt-daemon-driver-qemu (11.0.0-2ubuntu6) ... Default libvirt network on 192.168.122.1/24 already taken Changing to free 192.168.123.1/24 Enabling libvirt default network [...] => Hooray, libvirt-daemon-driver-qemu is now successfully configured! [ Where problems could occur ] - * We're introducing a Pre-Depends dependency on libvirt-daemon-config- - network from libvirt-daemon-driver-qemu, which could have unintended - side-effects and potentially lead to dependency loops. As we're now - enforcing libvirt-daemon-config-network to be installed and configured - before installing libvirt-daemon-driver-qemu. + * We're introducing a dependency on libvirt-daemon-config-network from + libvirt-daemon-driver-qemu, which could have unintended side-effects and + potentially lead to dependency loops. As we're now enforcing libvirt- + daemon-config-network to be configured before installing libvirt-daemon- + driver-qemu. [ Other Info ] - * The workaround is to "apt install libvirt-daemon-config-network". - - + * The workaround is to "apt install libvirt-daemon-config-network". ---- Original bug report ---- Lubuntu is unable to install virt-manager in a nested testing environment, due to a failure to install/configure libvirt-daemon- driver-qemu. Setting up libvirt-daemon-driver-qemu (11.0.0-2ubuntu6) ... [...] Default libvirt network on 192.168.122.1/24 already taken Changing to free 192.168.123.1/24 sed: can't read /etc/libvirt/qemu/networks/default.xml: No such file or directory dpkg: error processing package libvirt-daemon-driver-qemu (--configure): installed libvirt-daemon-driver-qemu package post-installation script subprocess returned error exit status 2 See: https://paste.ubuntu.com/p/BQBNgyRbGs/
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2107448 Title: libvirt-daemon-driver-qemu fails to install (--configure) due to .postinst issue To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-release-notes/+bug/2107448/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
