Bug 615854

Summary: virt-manager fails in weird way if home dir permissions are 0711
Product: Red Hat Enterprise Linux 6 Reporter: Ray Strode [halfline] <rstrode>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED WORKSFORME QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-20 20:54:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ray Strode [halfline] 2010-07-19 06:00:59 UTC
I tried to use virt-manager recently and it failed with this error:
[Mon, 19 Jul 2010 01:45:52 virt-manager 19010] DEBUG (error:86) Uncaught Error: Unable to complete install: 'internal error Process exited while reading console log output: char device redirected to /dev/pts/34
qemu: could not load kernel '/home/rstrode/.virtinst/boot/virtinst-vmlinuz.i3tEeu': Permission denied
' : Unable to complete install '<class 'libvirt.libvirtError'> internal error Process exited while reading console log output: char device redirected to /dev/pts/34
qemu: could not load kernel '/home/rstrode/.virtinst/boot/virtinst-vmlinuz.i3tEeu': Permission denied

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1561, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 974, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1039, in _do_install
    "install")
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1010, in _create_guest
    dom = self.conn.createLinux(start_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1270, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/34
qemu: could not load kernel '/home/rstrode/.virtinst/boot/virtinst-vmlinuz.i3tEeu': Permission denied'

After a bit of debugging it looks like what's going on is the vmlinuz file and initrd are getting chown'd to the "qemu" user and libvirt tries to run qemu as that qemu user which all fails because the qemu user isn't allowed to peer into my home dir (which had a mode of 0711).

chmod 755 /home/rstrode

worked around the issue.  

Proposing as a blocker because it means virt-manager fails in a very common configuration, but feel free to de-escalate if appropriate.

Comment 1 Cole Robinson 2010-07-20 20:32:54 UTC
Works for me here. If your homedir had 711 permissions, the qemu user should have been able to access the qemu owned file.

Are you using NFS homedir? Any chance this is selinux related?

If you change your permissions to 700 and the install, virt-manager should prompt to 'fix' perms using ACLs. Does that work?

Comment 2 Ray Strode [halfline] 2010-07-20 20:54:19 UTC
(In reply to comment #1)
> Works for me here. If your homedir had 711 permissions, the qemu user should
> have been able to access the qemu owned file.
Right.  I assumed it was doing some sort of opendir() call or something.

> Are you using NFS homedir? Any chance this is selinux related?
Not NFS. Also, I've been running with enforcing=0 lately.

> If you change your permissions to 700 and the install, virt-manager should
> prompt to 'fix' perms using ACLs. Does that work?    
So, just now I did this:

chmod 711 /home/rstrode 

and tried to recreate the problem…and I can't.  It's working fine now.  There must be some piece of the puzzle I'm missing, because it was reliably failing before (like a dozen times in a row or so).  Anyway, if I'm the only one who's seeing this issue and I can't even reproduce it anymore, I don't think there's much point keeping the bug open.  My machine isn't exactly what you might call "pristine" anyway, so it could just be random cruft at fault here.