Hide Forgot
Description of problem: $ virt-builder rhel-6.5 --selinux-relabel [ 0.2] Downloading: .../rhel-6.5.xz [ 0.8] Planning how to build this image [ 0.8] Uncompressing [ 13.3] Opening the new disk [ 25.9] Setting a random seed [ 25.9] Setting passwords virt-builder: Setting random password of root to 9tUGCecjfvaHS3Wm [ 27.0] SELinux relabelling virt-builder: error: libguestfs error: selinux_relabel: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument: Success Version-Release number of selected component (if applicable): libguestfs-1.34.0-1.fc24.x86_64 How reproducible: 100% However it is not a problem with later versions of RHEL, eg. rhel-6.8 works fine. Steps to Reproduce: 1. See above.
In the end, it was worked around in libguestfs by manually fixing a faulty selinux file_context file -- see more discussion in bug 1374232. Fixed with commits https://github.com/libguestfs/libguestfs/commit/25772a8123a1a800caf3472fb79c8eb3b4a074f3 https://github.com/libguestfs/libguestfs/commit/c6d8d68a4643794128c1d617bc83fc22438cc7c5 which are in libguestfs >= 1.37.1.