Bug 579067 - libvirt: qcow2/lvm backing image permissions are NOT changed to qemu:qemu
Summary: libvirt: qcow2/lvm backing image permissions are NOT changed to qemu:qemu
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 548401 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-02 12:52 UTC by thanosk
Modified: 2010-07-08 18:18 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.7.1-18.fc12
Clone Of:
Environment:
Last Closed: 2010-07-08 18:18:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description thanosk 2010-04-02 12:52:25 UTC
When I attempt to create a new VM I get the following error : 

Unable to complete install '<class 'libvirt.libvirtError'> internal error unable to start guest: qemu: could not open disk image /var/lib/libvirt/images/Test.img: Permission denied

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1435, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 660, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 758, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib/python2.6/site-packages/libvirt.py", line 1077, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error unable to start guest: qemu: could not open disk image /var/lib/libvirt/images/Test.img: Permission denied

The image file Test.img was alredy created using a different image file as base 
using the following command
qemu-img create -b CentOS.img -f  qcow2  Test.img

File permissions and SELinux Context seems appropriate

# ls -Z Test.img 
-rw-------. root root system_u:object_r:virt_image_t:s0 Torrent.img


The image loads without any problems from the command line as root using
qemu Test.img

Comment 1 Cole Robinson 2010-04-05 16:34:04 UTC
Hmm, I think there are known permission issues with libvirt security drivers and files with backing stores.

Can you provide:

ls -Z /var/lib/libvirt/images
virsh pool-list /var/lib/libvirt/images
virsh vol-dumpxml /var/lib/libvirt/images/Test.img

Does 'setenforce 0' help?

Re-assiging to libvirt.

Comment 2 thanosk 2010-04-05 20:16:00 UTC
# ls -Z /var/lib/libvirt/images/

-rw-------. root    root    system_u:object_r:virt_content_t:s0 CentOS-Base-1.img
-rwxr--r--. root    root    system_u:object_r:virt_content_t:s0 CentOS-Base.img
-rw-r--r--. root    root    unconfined_u:object_r:virt_image_t:s0 CentOS-TWiki.img
-rwxr--r--. root    root    unconfined_u:object_r:virt_image_t:s0 CentOS-Zimbra.img
-rw-------. root    root    system_u:object_r:virt_image_t:s0 Drupal.img
-rw-------. root    root    system_u:object_r:virt_image_t:s0 ProcessMaker.img
-rw-------. root    root    system_u:object_r:virt_image_t:s0 Qmail.img
-rw-------. root    root    system_u:object_r:virt_image_t:s0 Test.img
-rw-------. root    root    system_u:object_r:virt_image_t:s0 WindowsXP.img

# virsh pool-list /var/lib/libvirt/images/
error: unexpected data '/var/lib/libvirt/images/'

# virsh vol-dumpxml /var/lib/libvirt/images/Test.img
<volume>
  <name>Test.img</name>
  <key>/var/lib/libvirt/images/Test.img</key>
  <source>
  </source>
  <capacity>25769803776</capacity>
  <allocation>30613504</allocation>
  <target>
    <path>/var/lib/libvirt/images/Test.img</path>
    <format type='qcow'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_image_t:s0</label>
    </permissions>
  </target>
  <backingStore>
    <path>/var/lib/libvirt/images/CentOS-Base-1.img</path>
    <format type='raw'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:virt_content_t:s0</label>
    </permissions>
  </backingStore>
</volume>


SELinux is in permissive mode on purpose because I was getting too much grief 
from various applications

Comment 3 Bug Zapper 2010-04-28 12:00:50 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 thanosk 2010-04-28 16:21:16 UTC
I marked the bug as concerning ver 11 of Fedora by mistake. 
I am using F12

(In reply to comment #3)
> This message is a reminder that Fedora 11 is nearing its end of life.
> Approximately 30 (thirty) days from now Fedora will stop maintaining
> and issuing updates for Fedora 11.  It is Fedora's policy to close all
> bug reports from releases that are no longer maintained.  At that time
> this bug will be closed as WONTFIX if it remains open with a Fedora 
> 'version' of '11'.
> 
> Package Maintainer: If you wish for this bug to remain open because you
> plan to fix it in a currently maintained version, simply change the 'version' 
> to a later Fedora version prior to Fedora 11's end of life.
> 
> Bug Reporter: Thank you for reporting this issue and we are sorry that 
> we may not be able to fix it before Fedora 11 is end of life.  If you 
> would still like to see this bug fixed and are able to reproduce it 
> against a later version of Fedora please change the 'version' of this 
> bug to the applicable version.  If you are unable to change the version, 
> please add a comment here and someone will do it for you.
> 
> Although we aim to fix as many bugs as possible during every release's 
> lifetime, sometimes those efforts are overtaken by events.  Often a 
> more recent Fedora release includes newer upstream software that fixes 
> bugs or makes them obsolete.
> 
> The process we are following is described here: 
> http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Cole Robinson 2010-05-26 18:06:07 UTC
*** Bug 548401 has been marked as a duplicate of this bug. ***

Comment 6 Cole Robinson 2010-06-03 18:01:51 UTC
This is fixed upstream, moving to POST.

Comment 7 Fedora Update System 2010-06-17 16:55:38 UTC
libvirt-0.7.1-18.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/libvirt-0.7.1-18.fc12

Comment 8 Fedora Update System 2010-06-21 13:02:19 UTC
libvirt-0.7.1-18.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libvirt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libvirt-0.7.1-18.fc12

Comment 9 Fedora Update System 2010-07-08 18:17:07 UTC
libvirt-0.7.1-18.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.