>> [Rocky9]$ 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>This is just a bug. For reference what versions of libguestfs & >guestfs-tools are you using?Just the native EL9 versions $ rpm -q libguestfs guestfs-tools libguestfs-1.46.1-4.el9_0.alma.x86_64 guestfs-tools-1.46.1-6.el9.0.1.x86_64 (I am running on AlmaLinux9/Rocky9 as well) Not sure if this is the correct fix, but I test patched the distro matching and it seemed to fix this. (Although virt-builder did not link cleanly - fPIE ?) Thanks! Harry [cid:Corero-C-Emblem-Logo_45d4852f-9c54-43bf-890a-87cc840a4439.png]<https://www.corero.com/> Harry Bryson | Software Engineer [cid:1.Email-icon_26b8c770-e81e-4f66-a563-df28e00684aa.png] Harry.Bryson at corero.com<mailto:Harry.Bryson at corero.com> [cid:3.Map-icon_41ce7b53-a7ba-45b0-a0f5-984216110856.png] 53 Hanover Street, Edinburgh, EH2 2PJ United Kingdom [cid:4.Website-icon_66f93fb0-fb56-42b8-879c-68b071f492af.png]<https://www.corero.com>[cid:5.LinkedIn-icon_71e7bc7c-e732-410a-898f-d7fd45115cd4.png]<https://www.linkedin.com/company/corero>[cid:6.Twitter-icon_24fc5112-78a4-4303-af64-9ef3ec89fc44.png]<https://twitter.com/corero>[cid:7.Facebook-icon_a3c6fd35-9f1a-4019-951e-0763954abc5c.png]<https://www.facebook.com/corero.inc/>[cid:8.Youtube-icon_cd676141-8f09-4e1b-893d-da9b396d3d00.png]<https://www.youtube.com/user/corerosecurity/> Access Corero Network Security's Privacy Policy here<https://www.corero.com/privacy>. We are Corero Network Security plc ("Corero"), registered in England and Wales, with registered company number 02662978, registered office address Salisbury House, 29 Finsbury Circus, London, EC2M 5QQ. Corero is the parent company for Corero Network Security, Inc. and Corero Network Security (UK) Ltd (a company registered in England and Wales with registered number 04047090, with the same registered office address as above) For information about how we process your data, or to manage your data preferences, click here<https://info.corero.com/data-preferences.html>. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment.htm> -------------- next part -------------- A non-text attachment was scrubbed... Name: Corero-C-Emblem-Logo_45d4852f-9c54-43bf-890a-87cc840a4439.png Type: image/png Size: 11949 bytes Desc: Corero-C-Emblem-Logo_45d4852f-9c54-43bf-890a-87cc840a4439.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.Email-icon_26b8c770-e81e-4f66-a563-df28e00684aa.png Type: image/png Size: 1280 bytes Desc: 1.Email-icon_26b8c770-e81e-4f66-a563-df28e00684aa.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0001.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.Phone-icon_8e6fca71-ef0f-4a42-a9c9-c0b0f6217dd7.png Type: image/png Size: 3369 bytes Desc: 2.Phone-icon_8e6fca71-ef0f-4a42-a9c9-c0b0f6217dd7.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0002.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 3.Map-icon_41ce7b53-a7ba-45b0-a0f5-984216110856.png Type: image/png Size: 1021 bytes Desc: 3.Map-icon_41ce7b53-a7ba-45b0-a0f5-984216110856.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0003.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 4.Website-icon_66f93fb0-fb56-42b8-879c-68b071f492af.png Type: image/png Size: 1969 bytes Desc: 4.Website-icon_66f93fb0-fb56-42b8-879c-68b071f492af.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0004.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 5.LinkedIn-icon_71e7bc7c-e732-410a-898f-d7fd45115cd4.png Type: image/png Size: 1822 bytes Desc: 5.LinkedIn-icon_71e7bc7c-e732-410a-898f-d7fd45115cd4.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0005.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 6.Twitter-icon_24fc5112-78a4-4303-af64-9ef3ec89fc44.png Type: image/png Size: 1853 bytes Desc: 6.Twitter-icon_24fc5112-78a4-4303-af64-9ef3ec89fc44.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0006.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 7.Facebook-icon_a3c6fd35-9f1a-4019-951e-0763954abc5c.png Type: image/png Size: 1768 bytes Desc: 7.Facebook-icon_a3c6fd35-9f1a-4019-951e-0763954abc5c.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0007.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 8.Youtube-icon_cd676141-8f09-4e1b-893d-da9b396d3d00.png Type: image/png Size: 1809 bytes Desc: 8.Youtube-icon_cd676141-8f09-4e1b-893d-da9b396d3d00.png URL: <http://listman.redhat.com/archives/libguestfs/attachments/20221010/ed8dee7b/attachment-0008.png>
Richard W.M. Jones
2022-Oct-10 13:01 UTC
[Libguestfs] redhat-based EL9 distros not supported?
On Mon, Oct 10, 2022 at 08:51:00AM +0000, Harry Bryson wrote:> >> [Rocky9]$ 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 > > >This is just a bug. For reference what versions of libguestfs & > >guestfs-tools are you using? > > Just the native EL9 versions > $ rpm -q libguestfs guestfs-tools > libguestfs-1.46.1-4.el9_0.alma.x86_64 > guestfs-tools-1.46.1-6.el9.0.1.x86_64 > (I am running on AlmaLinux9/Rocky9 as well)What does Alma (as a guest image) return for inspect-get-distro? As far as I can tell we don't really support it in libguestfs so far. Anyway the attached patches should fix the issue for Rocky guest images, although it's not really long-term supportable to keep adding distros like this, we'll have to think of a better way. The bug is: https://bugzilla.redhat.com/show_bug.cgi?id=2133443> Not sure if this is the correct fix, but I test patched the distro matching and it seemed to fix this. > (Although virt-builder did not link cleanly - fPIE ?)You probably need to configure with: ./configure CFLAGS="-O2 -fPIC -g" (or alternatively just rebuild from the CentOS SRPM) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit -------------- next part -------------->From 85f3e4d084b71c4fac84d729f14c798001df2076 Mon Sep 17 00:00:00 2001From: "Richard W.M. Jones" <rjones at redhat.com> Date: Mon, 10 Oct 2022 13:59:00 +0100 Subject: [PATCH] common: customize: Support Rocky Linux Reported-by: Harry Benson Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2133443 --- mlcustomize/firstboot.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlcustomize/firstboot.ml b/mlcustomize/firstboot.ml index 5c7fd0d..0c76283 100644 --- a/mlcustomize/firstboot.ml +++ b/mlcustomize/firstboot.ml @@ -151,7 +151,8 @@ WantedBy=%s and install_sysvinit_service g root distro major match distro with - | "fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based" -> + | "fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"rocky"| + "redhat-based" -> install_sysvinit_redhat g | "opensuse"|"sles"|"suse-based" -> install_sysvinit_suse g -- 2.37.0.rc2 -------------- next part -------------->From ea0142b9906ee5844f58b13b72eb6150ee020b6a Mon Sep 17 00:00:00 2001From: "Richard W.M. Jones" <rjones at redhat.com> Date: Mon, 10 Oct 2022 13:54:52 +0100 Subject: [PATCH] customize: Support Rocky Linux Reported-by: Harry Benson Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2133443 --- customize/hostname.ml | 3 ++- customize/password.ml | 3 ++- customize/random_seed.ml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/customize/hostname.ml b/customize/hostname.ml index df64a2dab4..fabba3cfd7 100644 --- a/customize/hostname.ml +++ b/customize/hostname.ml @@ -36,7 +36,8 @@ let rec set_hostname (g : Guestfs.guestfs) root hostname update_etc_machine_info g hostname; true - | "linux", ("rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based"), v + | "linux", ("rhel"|"centos"|"scientificlinux"|"oraclelinux"|"rocky"| + "redhat-based"), v when v >= 7 -> update_etc_hostname g hostname; update_etc_machine_info g hostname; diff --git a/customize/password.ml b/customize/password.ml index 608bf95dcf..b37b31fcdc 100644 --- a/customize/password.ml +++ b/customize/password.ml @@ -160,7 +160,8 @@ and default_crypto g root let distro = g#inspect_get_distro root in let major = g#inspect_get_major_version root in match distro, major with - | ("rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based"), v when v >= 9 -> + | ("rhel"|"centos"|"scientificlinux"|"oraclelinux"|"rocky"| + "redhat-based"), v when v >= 9 -> `YESCRYPT | ("rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based"), v when v >= 6 -> `SHA512 diff --git a/customize/random_seed.ml b/customize/random_seed.ml index f32d3194ea..2dcb700eaa 100644 --- a/customize/random_seed.ml +++ b/customize/random_seed.ml @@ -47,7 +47,8 @@ let rec set_random_seed (g : Guestfs.guestfs) root let distro = g#inspect_get_distro root in let file match typ, distro with - | "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based") -> + | "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"| + "rocky"|"redhat-based") -> Some "/var/lib/random-seed" | "linux", ("debian"|"ubuntu"|"kalilinux") -> Some "/var/lib/urandom/random-seed" -- 2.37.0.rc2