Creating new VM in virt-manager fails

Bug #1439729 reported by Petter Adsen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Confirmed
High
Unassigned

Bug Description

Creating new VM in virt-manager fails:

Unable to complete install: 'internal error: process exited while connecting to monitor: 2015-04-02T14:34:00.518328Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/fedora-cloud.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: Permission denied
'

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 1819, 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 3422, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: 2015-04-02T14:34:00.518328Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/fedora-cloud.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: Permission denied

Logs:
april 02 16:34:00 monster audit[2106]: <audit-1400> apparmor="DENIED" operation="open" profile="libvirt-3d049f0b-f90d-4ef6-af58-6a2e2b238adb" name="/sys/devices/system/node/" pid=2106 comm="qemu-system-x86" requested_mask="r" denied_mask="r" fsuid=119 ouid=0
april 02 16:34:00 monster audit[2106]: <audit-1400> apparmor="DENIED" operation="open" profile="libvirt-3d049f0b-f90d-4ef6-af58-6a2e2b238adb" name="/sys/devices/system/cpu/" pid=2106 comm="qemu-system-x86" requested_mask="r" denied_mask="r" fsuid=119 ouid=0
april 02 16:34:00 monster audit[2106]: <audit-1400> apparmor="DENIED" operation="mknod" profile="libvirt-3d049f0b-f90d-4ef6-af58-6a2e2b238adb" name="/var/lib/libvirt/qemu/channel/target/fedora-cloud.org.qemu.guest_agent.0" pid=2106 comm="qemu-system-x86" requested_mask="c" denied_mask="c" fsuid=119 ouid=119
april 02 16:34:00 monster libvirtd[23179]: failed to connect to monitor socket: No such process
april 02 16:34:00 monster libvirtd[23179]: internal error: process exited while connecting to monitor: 2015-04-02T14:34:00.518328Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/fedora-cloud.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: Permission denied

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: libvirt-bin 1.2.12-0ubuntu8
ProcVersionSignature: Ubuntu 3.19.0-11.11-generic 3.19.3
Uname: Linux 3.19.0-11-generic x86_64
ApportVersion: 2.17-0ubuntu1
Architecture: amd64
CurrentDesktop: XFCE
Date: Thu Apr 2 16:32:56 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-03-08 (24 days ago)
InstallationMedia: Xubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
SourcePackage: libvirt
UpgradeStatus: Upgraded to vivid on 2015-03-21 (12 days ago)
modified.conffile..etc.apparmor.d.usr.lib.libvirt.virt.aa.helper: [modified]
modified.conffile..etc.libvirt.qemu.conf: [inaccessible: [Errno 13] Permission denied: '/etc/libvirt/qemu.conf']
modified.conffile..etc.libvirt.qemu.networks.default.xml: [inaccessible: [Errno 13] Permission denied: '/etc/libvirt/qemu/networks/default.xml']
mtime.conffile..etc.apparmor.d.usr.lib.libvirt.virt.aa.helper: 2015-03-31T16:03:32.987653

Revision history for this message
Petter Adsen (ducasse) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1439729] [NEW] Creating new VM in virt-manager fails

Thanks for reporting this bug. I can reproduce.

 status: confirmed

Changed in libvirt (Ubuntu):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

To make this work I needed two things:

sudo mkdir -p libvirt-qemu:kvm /var/lib/libvirt/qemu/channel/target
sudo chown libvirt-qemu:kvm /var/lib/libvirt/qemu/channel/target

and

/var/lib/libvirt/qemu/channel/target/* rw,

in the file /etc/apparmor.d/abstractions/libvirt-qemu.

The first should be done at postinst. The second should be done on a
per-vm basis (using the file name

/var/lib/libvirt/qemu/channel/target/$(vm).org.qemu.guest_agent.0

by virt-aa-helper.

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.