Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virt-customize: error: libguestfs error: could not create appliance through libvirt. #177

Open
nkm269 opened this issue Apr 1, 2025 · 2 comments

Comments

@nkm269
Copy link

nkm269 commented Apr 1, 2025

[root@hypnode1 oracle-linux-image-tools]# ./bin/build-image.sh --env env.properties
+++ build-image.sh: Parse arguments
+++ build-image.sh: Load environment
+++ build-image.sh: Retrieve installation media OracleLinux-R8-U10-x86_64-dvd.iso
build-image.sh: using cached file /u01/workspace/.cache/87d56829e702bbde27c2f4458648bcbb326fe307-OracleLinux-R8-U10-x86_64-dvd.iso
+++ build-image.sh: Stage provisioning files
+++ build-image.sh: Stage kickstart file
+++ build-image.sh: Install Oracle Linux

Starting install...
Retrieving file vmlinuz... | 10 MB 00:00:00
Retrieving file initrd.img... | 87 MB 00:00:00
Allocating 'OL8U10_x86_64-oci-b0.qcow2' | 15 GB 00:00:00

Domain is still running. Installation may be in progress.
Waiting 30 minutes for the installation to complete.

Domain has shutdown. Continuing.
Domain creation completed.
+++ build-image.sh: Run provisioning scripts
[ 0.0] Examining the guest ...
[ 9.9] Setting a random seed
[ 9.9] Copying: /u01/workspace/OL8U10_x86_64-oci-b0/provision.d to /tmp/
[ 9.9] Running: /bin/bash /tmp/provision.d/provision.sh

[ 152.7] SELinux relabelling
[ 159.4] Finishing off
+++ build-image.sh: Cleanup
[ 0.0] Examining the guest ...
[ 3.5] Performing "abrt-data" ...
[ 3.5] Performing "backup-files" ...
[ 3.8] Performing "bash-history" ...
[ 3.8] Performing "blkid-tab" ...
[ 3.9] Performing "crash-data" ...
[ 3.9] Performing "cron-spool" ...
[ 3.9] Performing "dhcp-client-state" ...
[ 3.9] Performing "dhcp-server-state" ...
[ 3.9] Performing "dovecot-data" ...
[ 3.9] Performing "ipa-client" ...
[ 3.9] Performing "kerberos-hostkeytab" ...
[ 3.9] Performing "logfiles" ...
[ 4.0] Performing "machine-id" ...
[ 4.0] Performing "mail-spool" ...
[ 4.0] Performing "net-hostname" ...
[ 4.0] Performing "net-hwaddr" ...
[ 4.0] Performing "pacct-log" ...
[ 4.1] Performing "package-manager-cache" ...
[ 4.1] Performing "pam-data" ...
[ 4.1] Performing "passwd-backups" ...
[ 4.1] Performing "puppet-data-log" ...
[ 4.1] Performing "rh-subscription-manager" ...
[ 4.1] Performing "rhn-systemid" ...
[ 4.1] Performing "rpm-db" ...
[ 4.1] Performing "samba-db-log" ...
[ 4.1] Performing "script" ...
[ 4.1] Performing "smolt-uuid" ...
[ 4.2] Performing "ssh-hostkeys" ...
[ 4.2] Performing "ssh-userdir" ...
[ 4.2] Performing "sssd-db-log" ...
[ 4.2] Performing "tmp-files" ...
[ 4.2] Performing "udev-persistent-net" ...
[ 4.2] Performing "utmp" ...
[ 4.2] Performing "yum-uuid" ...
[ 4.2] Performing "customize" ...
[ 4.2] Setting a random seed
[ 4.3] Setting the machine ID in /etc/machine-id
[ 4.3] Deleting: /.build-info
[ 4.3] Truncating: /etc/machine-id
[ 4.3] Truncating: /etc/resolv.conf
[ 4.3] Setting passwords
[ 5.1] SELinux relabelling
[ 11.6] Performing "lvm-uuids" ...
build-image.sh: SELinux relabel non-root filesystems
build-image.sh: skipping /
build-image.sh: relabelling /boot
build-image.sh: Sparsify image
[ 0.0] Create overlay file in /u01/workspace/OL8U10_x86_64-oci-b0/tmp.BObiwxXYR5 to protect source disk
[ 0.0] Examine source disk
virt-sparsify: error: libguestfs error: could not create appliance through
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: Cannot access storage file
'/u01/workspace/OL8U10_x86_64-oci-b0/tmp.BObiwxXYR5/sparsify6d0789.qcow2'
(as uid:107, gid:107): Permission denied [code=38 int1=13]

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

virt-sparsify -v -x [...]

@AmedeeBulle
Copy link
Member

See https://libguestfs.org/guestfs-faq.1.html - section ""Permission denied" when running libguestfs as root"

Basically, you should not run this script as root as mentioned in this project's README:

Run the builder as a non-privileged user

@nkm269
Copy link
Author

nkm269 commented Apr 1, 2025

okay.let me try again.thank you @AmedeeBulle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants