KVM permission issues during chapter 2 of Michael Jang's RHCSA/RHCE book
This is my first post so please bare with me. But I am currently studying for the RHCSA (which is why I chose to post this in this sub-forum). Also I was told by the author he helps on here. Anyhow. Chapter two of his book he deletes the /var/lib/libvirt/images and replaces it with a link to /home/(myusername)/KVM. But during the creation of my VM it says permission denied for the server1.example.com.img I have gone through and made sure I gave rwx permissions to all users with chmod 777 and looked over permissions everywhere I can think of. Any ideas or suggestions would be greatly helpful. I will post some information to hopefully help here.
[root@localhost ~]# ls -l /var/lib/libvirt/images lrwxrwxrwx. 1 root root 16 Aug 17 12:20 /var/lib/libvirt/images -> /home/smitty/KVM [root@localhost ~]# ls -l /var/lib/libvirt/images/server1.example.com.img -rwxrwxrwx. 1 root root 12884901888 Aug 17 13:13 /var/lib/libvirt/images/server1.example.com.img |
Quote:
Code:
ls -lZ /home/smitty/KVM -C |
[root@localhost ~]# ls -lZ /home/smitty/KVM/
-rwxrwxrwx. root root system_u:object_r:virt_image_t:s0 server1.example.com.img You are correct it was a suggestion, but my home directory had 100Gb so thought it was a good idea since that was my largest partition. Thank you for the help BTW. |
Quote:
Try this.. Code:
restorecon -F -R /home/smitty/KVM |
[root@localhost ~]# restorecon -F -R /home/smitty/KVM/
[root@localhost ~]# ls -lZ /home/smitty/KVM/ -rwxrwxrwx. root root unconfined_u:object_r:user_home_t:s0 server1.example.com.img ---------- Post added 08-17-12 at 07:12 PM ---------- Here is the error I get from the KVM during the creation. Unable to complete install: 'internal error Process exited while reading console log output: char device redirected to /dev/pts/1 qemu-kvm: -drive file=/var/lib/libvirt/images/server1.example.com.img,if=none,id=drive-virtio-disk0,format=raw,cache=none: could not open disk image /var/lib/libvirt/images/server1.example.com.img: Permission denied |
Quote:
Code:
cd /home/smitty --C |
semanage is not showing as an available command. Is there a package that is needed for this?
|
Quote:
Code:
yum provides \*/*bin/semanage --C |
found the package needed, this is the output.
<code> [root@localhost smitty]# semanage fcontext -a -t virt_image_t KVM restorecon -R -v KVM /usr/sbin/semanage: bad option </code> |
Quote:
This... Code:
semanage fcontext -a -t virt_image_t KVM ; restorecon -R -v KVM Code:
semanage fcontext -a -t virt_image_t KVM && restorecon -R -v KVM Then what is the ouput of... Code:
ls -lZ KVM Code:
ls -lZ KVM/* |
Code:
[root@localhost smitty]# semanage fcontext -a -t virt_image_t KVM && restorecon -R -v KVM |
Try installing "setroubleshoot-server" package, restart auditd and rsyslog services and watch /var/log/messages for SE Linux errors/violations. It should list errors in more readable form.
Other option is creating LVM based guests. You create LV ... say 10 gigs and call it lv_server1 (or whatever you want) and install guest on it (format: raw, cache: none). It should give you better performance then image based guest. Also, Virt-manager can manage your Volume Group as a storage pool (you must add it first) so you can create LVs for guests directly from Virt-manager. |
Quote:
Code:
semanage fcontext -a -t virt_image_t KVM && restorecon -R -v KVM I agree with stef80 ...would like to see what the logs look like. |
Maybe this would work better:
Code:
semanage fcontext -a -t virt_image_t "KVM(/.*)?" && restorecon -R -v KVM |
Quote:
Still probably need to install those SELinux debugging tools...if you're studying for the RHCSA; you're going to need it eventually anyway :-) -C |
All times are GMT -5. The time now is 09:58 PM. |