Bug 497112

Summary: virt-manager can't install from iso image located on a readonly nfs mount
Product: [Fedora] Fedora Reporter: Ales Zelinka <azelinka>
Component: virt-managerAssignee: Daniel Berrangé <berrange>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: berrange, crobinso, hbrock, quintela, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-22 13:31:59 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 Ales Zelinka 2009-04-22 12:53:39 UTC
Description of problem:
virt-manager tries to play nice with selinux, relabeling iso images so they can be used by qemu. But it fails when the image is located on a read-only nfs share. The usual last-resort workaround for selinux issues  - switching to permissive mode doesn't work, because virt-manager tries to relabel the files in permissive mode too.


Making a local copy of the iso file is not always an option.

Version-Release number of selected component (if applicable):
virt-manager-0.7.0-4.fc11.x86_64

How reproducible:
always

Steps to Reproduce:
1. mount read-only nfs with iso image in it
2. try to install from this image
  
Actual results:
Unable to complete install '<type 'exceptions.ValueError'> Unable to fix install volume SELinux labelling: [Errno 1] Operation not permitted
Please run 'chcon system_u:object_r:virt_content_t:s0 /mnt/pathtoiso/file.iso' manually and retry installation
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1495, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 541, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 628, in _do_install
    self._create_devices(meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 601, in _create_devices
    disk.setup(progresscb)
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 608, in setup
    self.setup_security_context()
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 711, in setup_security_context
    ("Please run 'chcon %s %s' manually and retry installation" % (wantLabel, self.path)))
ValueError: Unable to fix install volume SELinux labelling: [Errno 1] Operation not permitted
Please run 'chcon system_u:object_r:virt_content_t:s0 /mnt/pathtoiso/file.iso' manually and retry installation
'

Expected results:
working virtual machine

Additional info:
Would be nice if the relabeling was optional (selectable under advanced options of 5th installation step) with

 - default value on in enforcing mode
 - default off in permissive

Comment 1 Cole Robinson 2009-04-22 13:31:59 UTC
Should be fixed in latest python-virtinst.

*** This bug has been marked as a duplicate of bug 496340 ***