Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#41888 - [libvirt][virt-manager] Misleading optdepends and post_upgrade texts

Attached to Project: Community Packages
Opened by Bastien Traverse (Neitsab) - Tuesday, 09 September 2014, 13:16 GMT
Last edited by Sergej Pupykin (sergej) - Friday, 12 September 2014, 13:07 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

* In PKGBUILD:
- description of optdepend bridge-utils is: "for briged networking (default)", while NAT really is [1][2]; so the descriptions should be changed to reflect that (affects bridge-utils, dnsmasq and ebtables);
- ebtables and dnsmasq are __required__ for the default networking mode to work [3][4], but their descriptions doesn't reflect it either (say "dnsmasq: for NAT/DHCP for guests" and "ebtables: for networking"); adding a "required for default networking" could be helpful;
- more importantly, libvirtd.service cannot START without qemu installed (which desn't qualify it as an __optional__ dependency I guess); already reported in  FS#41187  but closed. If another hypervisor is to be installed (lxc, usermode, xen) it should also be added in optdepends and referred to as *required*.

* In libvirt.install:
- post_install() script refers to the wiki page (https://wiki.archlinux.org/index.php/Libvirt) which is currently rather messy (accuracy flag set on https://wiki.archlinux.org/index.php/Libvirt#Run_daemon);
- post_upgrade() says that "libvirt runs qemu from nobody:nobody by default" while it runs it from nobody:**kvm** (confirmed in  FS#41382 ), and it seems that if the group is changed to something else (like "qemu" or "libvirt") then KVM access throws error (see https://wiki.archlinux.org/index.php/Libvirt#Run_daemon as well).

[1] http://wiki.libvirt.org/page/VirtualNetworking#The_default_configuration
[2] http://wiki.libvirt.org/page/Networking#NAT_forwarding_.28aka_.22virtual_networks.22.29
[3] http://wiki.libvirt.org/page/Libvirtd_and_dnsmasq
[4] https://bugs.archlinux.org/task/41187

Additional info:
* package version(s): libvirt-1.2.8-1, virt-manager-1.1.0-1, virt-viewer-0.6.0-3

Steps to reproduce:
# pacman -S libvirt virt-manager virtviewer
# chown -R nobody:kvm /var/{run,lib,cache}/libvirt/qemu /var/lib/libvirt/images ### as per wiki
chown: incorrect group: « nobody:kvm »
# systemctl start libvirtd.service
# systemctl status libvirtd.service
* libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled)
Active: inactive (dead)
Docs: man:libvirtd(8)
http://libvirt.org

libvirtd[5208]: libvirt version: 1.2.8
libvirtd[5208]: Cannot check dnsmasq binary /sbin/dnsmasq: No such file or directory
libvirtd[5208]: direct firewall backend requested, but /sbin/ebtables is not available: No such file or directory
libvirtd[5208]: internal error: Failed to find path for dmidecode binary
libvirtd[5208]: invalid argument: Failed to parse group 'kvm'
libvirtd[5208]: Initialisation of QEMU state driver failed: invalid argument: Failed to parse group 'kvm'
libvirtd[5208]: Driver state initialisation failed

# virsh sysinfo
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

# virt-manager
--> error saying it cannot connect via qemu:///system

# pacman -S qemu
# systemctl start libvirtd.service
# systemctl status libvirtd.service
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled)
Active: active (running) since mar. 2014-09-09 14:46:46 CEST; 2s ago
Docs: man:libvirtd(8)
http://libvirt.org
Main PID: 18580 (libvirtd)
CGroup: /system.slice/libvirtd.service
└─18580 /usr/bin/libvirtd -p /var/run/libvirtd.pid

libvirtd[18580]: libvirt version: 1.2.8
libvirtd[18580]: Cannot check dnsmasq binary /sbin/dnsmasq: No such file or directory
libvirtd[18580]: direct firewall backend requested, but /sbin/ebtables is not available: No such file or directory
libvirtd[18580]: internal error: Failed to find path for dmidecode binary
libvirtd[18580]: internal error: Failed to find path for dmidecode binary
libvirtd[18580]: Unable to delete bridge virbr0: Device or resource busy

# chown -R nobody:kvm /var/{run,lib,cache}/libvirt/qemu /var/lib/libvirt/images

*** Networking part ***
# virsh net-list
Name State Autostart Persistent
----------------------------------------------------------

# pacman -S --asdeps ebtables
# systemctl restart libvirtd.service
# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled)
Active: active (running) since mar. 2014-09-09 14:59:43 CEST; 2min 11s ago
Docs: man:libvirtd(8)
http://libvirt.org
Main PID: 18996 (libvirtd)
CGroup: /system.slice/libvirtd.service
└─18996 /usr/bin/libvirtd -p /var/run/libvirtd.pid

libvirtd[18996]: libvirt version: 1.2.8
libvirtd[18996]: Cannot check dnsmasq binary /sbin/dnsmasq: No such file or directory
libvirtd[18996]: internal error: Failed to find path for dmidecode binary
libvirtd[18996]: internal error: Failed to find path for dmidecode binary
libvirtd[18996]: Unable to create bridge virbr0: File exists

# virsh net-list
Name State Autostart Persistent
----------------------------------------------------------

# systemctl reboot
...
--> Need to install dnsmasq as well for default NATed virtual network to work.

Suggestions:
1. Make qemu required dependency
2. add in optdepends that ebtables and dnsmasq are REQUIRED for the DEFAULT NATed virtual networking
3. remove mention of "default" for bridge-utils
4. somebody knowledgeable enough update the wiki (I'm already preparing an overhaul but I'm no libvirt/qemu/kvm guru)
5. change post_install() to say "...nobody:kvm" and "change the group with caution" (the user's alright)

Example PKGBUILD and libvirt.install integrating suggestions attached
This task depends upon

Closed by  Sergej Pupykin (sergej)
Friday, 12 September 2014, 13:07 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in svn/trunk only, but I left qemu in optdeps.

Loading...