Description of problem: Rocky Linux is a RHEL derivative. It is not supported by virt-customize for operations like installing firstboot scripts, eg: $ virt-customize -a disk.qcow2 --firstboot-command /tmp/bootstrap [ 0.0] Examining the guest ... [ 17.1] Setting a random seed [ 17.3] Installing firstboot command: /tmp/bootstrap virt-customize: error: guest type rocky is not supported Version-Release number of selected component (if applicable): (Note these are Alma Linux packages, where Alma is a different RHEL rebuild) libguestfs-1.46.1-4.el9_0.alma.x86_64 guestfs-tools-1.46.1-6.el9.0.1.x86_64 How reproducible: 100% Steps to Reproduce: 1. Try to customize a Rocky Linux image using the --firstboot option. Additional info: Reported by Harry Bryson here: https://listman.redhat.com/archives/libguestfs/2022-October/030141.html
Patches posted: https://listman.redhat.com/archives/libguestfs/2022-October/030145.html
I can reproduce this issue on RHEL9.2 host: Steps: $ rpm -q libguestfs guestfs-tools libguestfs-1.48.4-2.el9.x86_64 guestfs-tools-1.48.2-5.el9.x86_64 $ virt-customize -a /var/lib/libvirt/images/Rocky-8.5.qcow2 --firstboot-command /tmp/bootstrap [ 0.0] Examining the guest ... [ 10.5] Setting a random seed [ 10.5] Installing firstboot command: /tmp/bootstrap virt-customize: error: guest type rocky is not supported If reporting bugs, run virt-customize with debugging enabled and include the complete output: virt-customize -v -x [...]
Upstream in: https://github.com/rwmjones/guestfs-tools/commit/8858fc63e63ae3f7c76d3ca96cbf63f43e76c834
Hi,rjones Seems like the latest guestfs-tools-1.48.2-6.el9 does not work. Steps: 1. On RHEL9.2 host $ virt-customize -v -x -a Rocky-8.5.qcow2 --firstboot-command /tmp/bootstrap ... libguestfs: trace: mkdir_p "/etc/systemd/system/multi-user.target.wants" guestfsd: => internal_write (0xf6) took 0.00 secs guestfsd: <= mkdir_p (0x21) request length 88 bytes libguestfs: trace: mkdir_p = 0 libguestfs: trace: ln_sf "/usr/lib/systemd/system/guestfs-firstboot.service" "/etc/systemd/system/multi-user.target.wants" guestfsd: => mkdir_p (0x21) took 0.00 secs guestfsd: <= ln_sf (0xa7) request length 144 bytes commandrvf: stdout=n stderr=y flags=0x0 commandrvf: ln -sf -- /usr/lib/systemd/system/guestfs-firstboot.service /sysroot/etc/systemd/system/multi-user.target.wants guestfsd: => ln_sf (0xa7) took 0.00 secs libguestfs: trace: ln_sf = 0 libguestfs: trace: is_file "/usr/lib/systemd/system/firstboot.service" guestfsd: <= is_file (0x25) request length 92 bytes chroot: /sysroot: running 'is_file: /usr/lib/systemd/system/firstboot.service' guestfsd: => is_file (0x25) took 0.00 secs libguestfs: trace: is_file = 0 libguestfs: trace: rm_f "/etc/systemd/system/default.target.wants/guestfs-firstboot.service" guestfsd: <= rm_f (0x16f) request length 112 bytes guestfsd: => rm_f (0x16f) took 0.00 secs libguestfs: trace: rm_f = 0 libguestfs: trace: is_dir "/etc/rc.d" guestfsd: <= is_dir (0x26) request length 60 bytes chroot: /sysroot: running 'is_dir: /etc/rc.d' libguestfs: trace: is_dir = 1 virt-customize: error: guest type rocky is not supported ...
Yes, I didn't apply the patch :-(
https://gitlab.com/redhat/centos-stream/rpms/guestfs-tools/-/merge_requests/18
(In reply to Richard W.M. Jones from comment #8) > https://gitlab.com/redhat/centos-stream/rpms/guestfs-tools/-/merge_requests/ > 18 Ok :)
Tested with package: guestfs-tools-1.48.2-7.el9.x86_64 Steps: 1. On RHEL9.2 host $ virt-customize -a Rocky-8.5.qcow2 --firstboot-command /tmp/bootstrap [ 0.0] Examining the guest ... [ 9.6] Setting a random seed [ 9.7] Installing firstboot command: /tmp/bootstrap [ 9.7] SELinux relabelling [ 23.2] Finishing off It works well.
Verified with package: guestfs-tools-1.48.2-7.el9.x86_64 Steps: 1. On RHEL9.2 host $ virt-customize -a Rocky-8.5.qcow2 --firstboot-command /tmp/bootstrap 0.0] Examining the guest ... [ 7.5] Setting a random seed [ 7.5] Installing firstboot command: /tmp/bootstrap [ 7.8] SELinux relabelling [ 35.9] Finishing off It works.
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 (guestfs-tools bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2023:2189