RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1362669 - Backport improved --selinux-relabel support for virt-sysprep, virt-builder, virt-customize
Summary: Backport improved --selinux-relabel support for virt-sysprep, virt-builder, v...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-02 19:53 UTC by Richard W.M. Jones
Modified: 2016-11-03 18:03 UTC (History)
2 users (show)

Fixed In Version: libguestfs-1.32.6-4.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:03:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 0 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 12:06:51 UTC

Description Richard W.M. Jones 2016-08-02 19:53:10 UTC
Description of problem:

In upstream libguestfs the behaviour of the --selinux-relabel
flag on the tools virt-sysprep, virt-builder and virt-customize
has been greatly improved.  In most cases we no longer require
a reboot to relabel a guest.  Also the relabelling works for
any guest, silently ignoring non-selinux guests.

Version-Release number of selected component (if applicable):

libguestfs 1.32.6-2.el7

Additional info:

The upstream commits required are:

9d205f1c284a69390907120ca44f5c723fecc244
6ec75f8cfe455493b46f1a3a5a00282359e588a5
f3c69fe60bc29ebfcef0ea9d86d407e1a88686b0
b6e92b1100b4ca462a35549bd36322f0510739bc
35bac3a6501354e4a3805877d950e741429f169b
fc114904848559e02d8f4e4a8bfb57277c349f0f
fcce1f694e46933dd5d6a0ef1369cef3c5152fc5
8689bfa4375c9de920b0b8587465be24d425bb4f

Comment 1 Richard W.M. Jones 2016-08-02 20:26:32 UTC
How to test:

$ virt-builder fedora-23 \
    --install "@Xfce Desktop" --update --root-password password:123456 --selinux-relabel

$ guestfish --ro -a fedora-23.img -i

Using guestfish check that /.autorelabel is *not* created.

$ virt-install --import --name test --ram 2048 --disk path=fedora-23.img,format=raw --os-variant fedora23

When it boots for the first time, ensure that services start up
correctly (not lots of "FAIL" lines or other errors during boot), and
ensure it does *not* reboot automatically because of autorelabel.

Inside the guest:

* You can log in as root (password: 123456).
* SELinux should be enforcing.

X11 should probably work too, but I cannot get it to start.  I think I'm
missing some packages, and it's not a SELinux error.

Comment 3 Xianghua Chen 2016-08-15 09:52:17 UTC
Verified with packages:
libguestfs-1.32.7-1.el7.x86_64


Verify steps:
1. Create a new guest image: fedora-22.img
# virt-builder fedora-22  --install "@Xfce Desktop" --update --root-password password:123456 --selinux-relabel
2. 
# guestfish --ro -a fedora-22.img -i
><fs> ls /
Check that /.autorelabel is *not* created
3. Start the guest image:
# virt-install --import --name test --ram 2048 --disk path=fedora22.img,format=raw --os-variant fedora22
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 12    test                           running
# virsh console 12
4. Log into the guest use root , password is 123456
# cat /var/log/boot.log
Check the /var/log/boot.log that services start up correctly (not lots of "FAIL" lines or other errors during boot), and ensure it does *not* reboot automatically because of autorelabel.

Comment 5 errata-xmlrpc 2016-11-03 18:03:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2576.html


Note You need to log in before you can comment on or make changes to this bug.