missing dirs /var/lib/libvirt/qemu/channel/target while creating centos 7 vm

Bug #1407434 reported by P
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Confirmed
High
Unassigned

Bug Description

I am trying to create a centos 7 VM from an already existing qcow2 disk, but the following error occur during creation :

Impossible de terminer l'installation : « internal error: process exited while connecting to monitor: 2015-01-04T13:34:14.057984Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such file or directory
2015-01-04T13:34:14.058114Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: chardev: opening backend "socket" failed
 »

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1820, in do_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 403, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 467, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3398, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: 2015-01-04T13:34:14.057984Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such file or directory
2015-01-04T13:34:14.058114Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: chardev: opening backend "socket" failed

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: libvirt0 1.2.8-0ubuntu11.1
ProcVersionSignature: Ubuntu 3.16.0-28.38-lowlatency 3.16.7-ckt1
Uname: Linux 3.16.0-28-lowlatency x86_64
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
Date: Sun Jan 4 14:30:12 2015
InstallationDate: Installed on 2015-01-03 (1 days ago)
InstallationMedia: Kubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
ProcEnviron:
 LANGUAGE=fr_FR
 TERM=xterm
 PATH=(custom, no user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
P (p92) wrote :
Revision history for this message
P (p92) wrote :

manually creating the directories with libvirt-qemu/kvm owner/group
/var/liib/libvirt/qemu/channel

leads to error : no such file or directory
for : /var/liib/libvirt/qemu/channel/target

Revision history for this message
P (p92) wrote :

manually creating the directory with libvirt-qemu/kvm owner/group
/var/liib/libvirt/qemu/channel/target

leads to error : permission denied

Impossible de terminer l'installation : « internal error: process exited while connecting to monitor: 2015-01-04T13:41:21.316581Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: Permission denied
2015-01-04T13:41:21.316717Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: chardev: opening backend "socket" failed
 »

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1820, in do_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 403, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 467, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3398, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: 2015-01-04T13:41:21.316581Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: Permission denied
2015-01-04T13:41:21.316717Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0,server,nowait: chardev: opening backend "socket" failed

Looking at syslog I know see apparmor is denying mknod creation on the directory :

Jan 4 14:41:21 minipc kernel: [127823.552343] audit: type=1400 audit(1420378881.315:171): apparmor="DENIED" operation="mknod" profile="libvirt-73aa79f1-0023-4e37-8001-5be78e884348" name="/var/lib/libvirt/qemu/channel/target/centostest.org.qemu.guest_agent.0" pid=28480 comm="qemu-system-x86" requested_mask="c" denied_mask="c" fsuid=116 ouid=116

So tu summarize :
- there are missing dirs
- there are missing rules for these dirs

summary: - apparmor denied mknod creation in /var/lib/libvirt/qemu/channel/target
+ missing dirs /var/lib/libvirt/qemu/channel/target while creating centos
+ 7 vm
Revision history for this message
P (p92) wrote :

I am runing virt-manager, laucned from user pascal when creating the VM

the groups for this user are :
uid=1000(pascal) gid=1000(pascal) groupes=1000(pascal),4(adm),6(disk),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),125(sambashare),126(kvm),127(libvirtd)

Revision history for this message
P (p92) wrote :

I was using a rhel7 vm type at creation.

the current content of /etc/apparmor.d/libvirt/libvirt-73aa79f1-0023-4e37-8001-5be78e884348.files :

# DO NOT EDIT THIS FILE DIRECTLY. IT IS MANAGED BY LIBVIRT.
  "/var/log/libvirt/**/centostest.log" w,
  "/var/lib/libvirt/**/centostest.monitor" rw,
  "/var/run/libvirt/**/centostest.pid" rwk,
  "/run/libvirt/**/centostest.pid" rwk,
  "/var/run/libvirt/**/*.tunnelmigrate.dest.centostest" rw,
  "/run/libvirt/**/*.tunnelmigrate.dest.centostest" rw,
  "/mnt/synology-iscsi/vms/centostest.img" rw,
  /dev/vhost-net rw,
  "/dev/net/tun" rw,

Revision history for this message
P (p92) wrote :

WORKAROUND for those who want to go on with MV creation while this bug is valid :

0. do not quit virt-manager vm creation

1. locate apparmor profile for your VM with ls-ltr /etc/apparmor.d/libvirt/libvirt-*
(the long string with numbers is your vm UUID - look inside to find your vm name)

2. set this apparmor profil in complain mode
# aa-complain /etc/apparmor.d/libvirt/libvirt-73aa79f1-0023-4e37-8001-5be78e884348 (for example)

3. go on with vm creation - it will succeed

Revision history for this message
richud (richud.com) wrote :

I think this is a duplicate of #1393842

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libvirt (Ubuntu):
status: New → Confirmed
Changed in libvirt (Ubuntu):
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.