Bug 2133443 - RFE: Support Rocky Linux in virt-customize
Summary: RFE: Support Rocky Linux in virt-customize
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: guestfs-tools
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: YongkuiGuo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-10 12:58 UTC by Richard W.M. Jones
Modified: 2023-05-09 08:19 UTC (History)
5 users (show)

Fixed In Version: guestfs-tools-1.48.2-8.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:30:51 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-136029 0 None None None 2022-10-10 13:02:12 UTC
Red Hat Product Errata RHBA-2023:2189 0 None None None 2023-05-09 07:30:54 UTC

Description Richard W.M. Jones 2022-10-10 12:58:32 UTC
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

Comment 2 Richard W.M. Jones 2022-10-10 13:01:51 UTC
Patches posted:
https://listman.redhat.com/archives/libguestfs/2022-October/030145.html

Comment 3 YongkuiGuo 2022-10-11 01:28:06 UTC
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 [...]

Comment 5 YongkuiGuo 2022-10-12 06:34:45 UTC
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
...

Comment 7 Richard W.M. Jones 2022-10-12 09:28:54 UTC
Yes, I didn't apply the patch :-(

Comment 9 YongkuiGuo 2022-10-12 09:33:29 UTC
(In reply to Richard W.M. Jones from comment #8)
> https://gitlab.com/redhat/centos-stream/rpms/guestfs-tools/-/merge_requests/
> 18

Ok :)

Comment 10 YongkuiGuo 2022-10-13 09:57:43 UTC
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.

Comment 13 YongkuiGuo 2022-10-26 09:21:50 UTC
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.

Comment 15 errata-xmlrpc 2023-05-09 07:30:51 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 (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


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