Running a RHEL8 guest on a RHEL7 host

If you're trying to create a RHEL8 guest image to be used on a RHEL7 host, you may find yourself staring at the following error message from virt-install (or some other tool you're using to boot the guest):

virt-resize: error: libguestfs error: mount: mount exited with status 32:
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

If reporting bugs, run virt-resize with debugging enabled and include the
complete output:

  virt-resize -v -x [...]

Running the virt-install command in verbose mode (-v) shows the following message right before the mount error:

command: mount '/dev/sda1' '/sysroot//'
[    1.675254] SGI XFS with ACLs, security attributes, no debug enabled
[    1.682107] XFS (sda1): Superblock has unknown read-only compatible features (0x4) enabled.
[    1.684106] XFS (sda1): Attempted to mount read-only compatible filesystem read-write.
[    1.685894] XFS (sda1): Filesystem can only be safely mounted read only.
[    1.687419] XFS (sda1): SB validate failed with error -22.

This is happening because the RHEL8 guest XFS filesystem is using XFS v5 and contains features not supported by the RHEL7 kernel from the host.

To continue, you need to disable those features in the guest by passing the -m reflink=0 option to mkfs.

If you're using Packer and booting through a kickstart file, the part command will look something like this:

part / --fstype=xfs --mkfsoptions="-m reflink=0" --size=1000 --grow

You can find more information about this in the Red Hat KB article.