Bug 517308

Summary: Fails to install to image file in home directory
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: berrange, clalance, crobinso, itamar, markmc, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-15 04:52:47 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Tim Waugh 2009-08-13 09:13:50 EDT
Description of problem:
I have a directory 'VM' in my home directory, and used this command to set the SELinux file contexts appropriately:

semanage fcontext -a -t virt_image_t '/home/twaugh/VM(/.*)?'

There is a file there, F11.img:

-rw-r--r--. root root system_u:object_r:virt_image_t:s0 F11.img

While attempting to install a guest in /home/twaugh/VM/F11.img I get a traceback:

Unable to complete install '<class 'libvirt.libvirtError'> internal error unable to start guest: qemu: could not open disk image /home/twaugh/VM/F11.img

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1489, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 628, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 726, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/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 /home/twaugh/VM/F11.img


Same configuration worked in Fedora 11.

Version-Release number of selected component (if applicable):

How reproducible:
Comment 1 Daniel Berrange 2009-08-13 09:38:27 EDT
Can you confirm whether  /home/twaugh/VM  is world readable - eg so 'qemu' unprivileged user can open files in that directory ?
Comment 2 Tim Waugh 2009-08-15 04:52:47 EDT
Oh, my home directory wasn't.  That fixes it.  Sorry for the noise, hadn't realised libvirt was no longer root...