I am trying to set up a test kvm virtual machine on a core2 quad system. I have managed to thread my way through bridging eth0 and I have a CentOS-5.4 dvd iso prepared. Using virt-manager, when I try and add a new guest then I get the error reproduced below. Now, I know that I can 'fix' this by building a local mod via audit2allow and installing via semodule. However, I cannot seem to find this particular problem when I Google for it. Therefore, it seems likely that I have done something wrong rather than having encountered a bug. Does anyone have any suggestions as to what step I may have missed in setting up a kvm guest? All I have done so far is: Install qemu. Set libvirtd to start at boot. Bridge eth0 to br0 via customs ifcfg-X scripts in /etc/sysconfig/network-scripts. Run virt-manager. Add a new guest. Summary: SELinux is preventing qemu-system-x86 (qemu_t) "read" to rtc (clock_device_t). Detailed Description: SELinux denied access requested by qemu-system-x86. It is not expected that this access is required by qemu-system-x86 and this access may signal an intrusion attempt. It is also possible that the specific version or configuration of the application is causing it to require additional access. Allowing Access: Sometimes labeling problems can cause SELinux denials. You could try to restore the default system file context for rtc, restorecon -v 'rtc' If this does not work, there is currently no automatic way to allow this access. Instead, you can generate a local policy module to allow this access - see FAQ (http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable SELinux protection altogether. Disabling SELinux protection is not recommended. Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package. Additional Information: Source Context system_u:system_r:qemu_t:SystemLow-SystemHigh Target Context system_u:object_r:clock_device_t Target Objects rtc [ chr_file ] Source qemu-system-x86 Source Path /usr/bin/qemu-system-x86_64 Port <Unknown> Host inet02.hamilton.harte-lyne.ca Source RPM Packages qemu-0.9.0-4 Target RPM Packages Policy RPM selinux-policy-2.4.6-255.el5_4.1 Selinux Enabled True Policy Type targeted MLS Enabled True Enforcing Mode Enforcing Plugin Name catchall_file Host Name inet02.hamilton.harte-lyne.ca Platform Linux inet02.hamilton.harte-lyne.ca 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 Alert Count 1 First Seen Mon 09 Nov 2009 06:28:32 PM EST Last Seen Mon 09 Nov 2009 06:28:32 PM EST Local ID d8ca7ab9-f135-4700-a515-c7b8efba1e27 Line Numbers Raw Audit Messages host=inet02.hamilton.harte-lyne.ca type=AVC msg=audit(1257809312.343:21): avc: denied { read } for pid=4166 comm="qemu-system-x86" name="rtc" dev=tmpfs ino=796 scontext=system_u:system_r:qemu_t:s0-s0:c0.c1023 tcontext=system_u:object_r:clock_device_t:s0 tclass=chr_file host=inet02.hamilton.harte-lyne.ca type=SYSCALL msg=audit(1257809312.343:21): arch=c000003e syscall=2 success=no exit=-13 a0=4d8b3c a1=0 a2=0 a3=8 items=0 ppid=1 pid=4166 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="qemu-system-x86" exe="/usr/bin/qemu-system-x86_64" subj=system_u:system_r:qemu_t:s0-s0:c0.c1023 key=(null) -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
James B. Byrne wrote on Mon, 9 Nov 2009 10:44:36 -0500 (EST):> Install qemu.> SELinux denied access requested by qemu-system-x86.I'm not running KVM (but Xen). From the snippets above I deduce: - qemu is not part of CentOS, you probably got it from rpmforge. - that means you do not need qemu for KVM usage - SELinux cannot know about it - there's probably a different preferred way to use KVM on CentOS Kai -- Kai Sch?tzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com
On Mon, November 9, 2009 10:44, James B. Byrne wrote:> I'm not running KVM (but Xen). From the snippets above I deduce: > > - qemu is not part of CentOS, you probably got it from rpmforge. > - that means you do not need qemu for KVM usage > - SELinux cannot know about it > - there's probably a different preferred way to use KVM on CentOSOdd then, do you not think, that when I install virt-manager yum requires qemu from the extras repository and does not require kvm-qemu-img. Odder still that yum seems not to know anything about kvm-qemu-img. # yum whatprovides */kvm-qemu-img Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.mirror.iweb.ca * base: centos.mirror.iweb.ca * extras: centos.mirror.iweb.ca * updates: centos.mirror.iweb.ca No Matches found # yum install virt-manager Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.csclub.uwaterloo.ca * base: mirror.csclub.uwaterloo.ca * extras: mirror.csclub.uwaterloo.ca * updates: mirror.csclub.uwaterloo.ca Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package virt-manager.x86_64 0:0.6.1-8.el5 set to be updated --> Processing Dependency: libvirt-python >= 0.3.3 for package: virt-manager --> Processing Dependency: python-virtinst >= 0.400.3 for package: virt-manager --> Running transaction check ---> Package libvirt-python.x86_64 0:0.6.3-20.1.el5_4 set to be updated --> Processing Dependency: libvirt.so.0(LIBVIRT_0.1.0)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.6.1)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.1.9)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.1.1)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.6.3)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.2.0)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.5.0)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.4.1)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.1.4)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.2.3)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.3.0)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.1.5)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.4.0)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.0.3)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.6.0)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.3.3)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.2.1)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.0.5)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.4.5)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0(LIBVIRT_0.3.2)(64bit) for package: libvirt-python --> Processing Dependency: libvirt.so.0()(64bit) for package: libvirt-python ---> Package python-virtinst.noarch 0:0.400.3-5.el5 set to be updated --> Running transaction check ---> Package libvirt.x86_64 0:0.6.3-20.1.el5_4 set to be updated --> Processing Dependency: /usr/bin/qemu-img for package: libvirt --> Running transaction check ---> Package qemu.x86_64 0:0.9.0-4 set to be updated --> Finished Dependency Resolution Dependencies Resolved =============================================================================== Package Arch Version Repository Size ===============================================================================Installing: virt-manager x86_64 0.6.1-8.el5 base 1.5 M Installing for dependencies: libvirt x86_64 0.6.3-20.1.el5_4 updates 2.0 M libvirt-python x86_64 0.6.3-20.1.el5_4 updates 133 k python-virtinst noarch 0.400.3-5.el5 base 378 k qemu x86_64 0.9.0-4 extras 4.5 M Transaction Summary ===============================================================================Install 5 Package(s) Update 0 Package(s) Remove 0 Package(s) -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
I removed qemu and reinstalled virt-manager using the -x qemu switch. Everything installs and I get kvm-qemu-img instead of qemu. Of course, virt-manager now does not work. It opens but it does not provide any means of adding a new virtual host. This places me back at my point of departure, albeit in a much fouler mood. I am afraid I am not seeing the logic behind this sort of install cockup. If qemu is not supposed to be used at all then why is it even available and why does it install in preference to kvm-qemu-img? If kvm-qemu-img is supposed to be used instead of qemu then why does not virt-manager work with it? If qemu is supposed to be used if one uses virt-manager then why does qemu violate the SELinux profile? If virt-manager is not supposed to be used then why is it available? Am I missing something obvious here. Is there a way to configure virt-manager or kvm-qemu-img so that they work together? Sincerely, -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
> Of course, virt-manager now does not work. It opens but it does > not provide any means of adding a new virtual host.What are the symptoms? Does virt-manager ask for your root password when starting? Did you try with SELinux in permissive mode? I recommend that you install setroubleshoot, it helps to debug SELinux issues, and will be notified when in permissive mode as well: sudo yum install setroubleshoot