wtorek, 5 lipca 2011

Linux: SELinux and kvm making it working

Today I have installed the SELinux from the repo on my Ubuntu Natty box (apt-get install selinux) and the kvm stopped working. Fortunately finding the solution was not that difficult - in my case it was the type that was assigned to the image file. Originally after installation of SELinux it looked like this:

krychu@krystianek:/var/lib/libvirt/images$ ls -lZ
total 27673348
-rw-------. 1 root root system_u:object_r:var_lib_t:s0 10737418240 2011-07-04 22:38 centos-clone.img
-rw-------. 1 root root system_u:object_r:var_lib_t:s0 10737418240 2011-07-04 22:38 centos.img
-rw-------. 1 root root system_u:object_r:var_lib_t:s0 21474836480 2011-07-05 13:57 windows7.img

 It inherited the type after the main dir (var).  After changing it to virt_image_t everything worked fine - please take a look at the commands below:

root@krystianek:/var/lib/libvirt/images# chcon -h -u system_u -r object_r -t virt_image_t *.img
root@krystianek:/var/lib/libvirt/images# ls -lZ
total 27674164
-rw-------. 1 root root system_u:object_r:virt_image_t:s0 10737418240 2011-07-04 22:38 centos-clone.img
-rw-------. 1 root root system_u:object_r:virt_image_t:s0 10737418240 2011-07-04 22:38 centos.img
-rw-------. 1 root root system_u:object_r:virt_image_t:s0 21474836480 2011-07-05 20:42 windows7.img

Voila - great and now the kvm seems to be working again!

Brak komentarzy:

Prześlij komentarz