Tuesday, November 19, 2013

qemu-system-x86_64: error while loading shared libraries: libGL.so.1: failed to map segment from shared object: Permission denied

Are you getting this error when trying to start a libvirt KVM VM on Fedora 20?

qemu-system-x86_64: error while loading shared libraries: libGL.so.1: failed to map segment from shared object: Permission denied

Seems to be caused by Nvidia proprietary drivers. Whatever black magic they are doing behind the scenes is upsetting the selinux restrictions qemu is run under.

The fix:

sudo setsebool -P virt_use_execmem=on


(update Jan 2016: the original bug that prompted this post had some follow up discussion about a possible cause, so maybe it's fixable: https://bugzilla.redhat.com/show_bug.cgi?id=966695)

14 comments:

  1. Fixed it for me using amd catalyst drivers

    ReplyDelete
  2. Thank you, fixed the error perfectly!

    ReplyDelete
  3. Thanks man, that was right on the spot!
    Black magic indeed. How did you discover the connection (besides the obvious reference to the GL-lib)?

    ReplyDelete
    Replies
    1. This issue started as a number of libvirt/qemu/virt-manager bug reports that eventually identified the common thread of nvidia drivers, anything mentioning libGL is always a red flag. The selinux workaround came from selinux maintainers

      Delete