Smoothwall Firewall project

Wednesday, 30 April 2014

Problem loading/starting a KVM virtual machine on a CentOS 6.5 host that has SELINUX disabled


If you have recently built a KVM host for all your virtual machines and left SELINUX enabled, then all will be well, but what happens when you turn that setting off. Well you will end up with VM's that won't load with the error message

error: Failed to start domain Ubuntu1404
error: unsupported configuration: Unable to find security driver for label selinux


It is easy to fix , use the following command and just remove the seclabel section on the virtual machine domain XML - virsh edit Ubuntu1404

# virsh edit Ubuntu1404
...
  <;seclabel type='dynamic' model='selinux' relabel='yes'>;
    <label>system_u:system_r:svirt_t:s0:c95,c664</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c95,c664</imagelabel>
  </seclabel>  

Once you have done that, the domains will load as normal.

Make sure if you have backup's of the domain XML, they are also changed, as I have found that they will over write the domain if your not careful

Check in /etc/libvirt/qemu to make sure the changes have happen, and the XML has been updated.

No comments: