From 033faa4b9d0350cb960562b2227f59d5246d95e3 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Wed, 28 Jun 2023 16:56:56 +0200 Subject: vm-images: add connection to qemu:///system Use system mode as suggested by the documentation. Added a note for directory permissions --- vm-images/create_coreos_vm.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vm-images/create_coreos_vm.sh b/vm-images/create_coreos_vm.sh index 03ac937..e8b11b4 100755 --- a/vm-images/create_coreos_vm.sh +++ b/vm-images/create_coreos_vm.sh @@ -28,7 +28,7 @@ IMAGE=${LIBVIRT_IMAGES}/${IMAGE_NAME} set -e # Don't execute the script if VM is still exists in libvirt -if virsh list --all | grep ${VM_NAME} ; then +if virsh --connect="qemu:///system" list --all | grep ${VM_NAME} ; then echo "VM ${VM_NAME} still exists" exit 0 fi @@ -49,7 +49,10 @@ podman run --interactive --rm --security-opt label=disable \ chcon --verbose --type svirt_home_t ${IGNITION_CONFIG} # Install the VM -virt-install --name="${VM_NAME}" --vcpus="${VCPUS}" --memory="${RAM_MB}" \ +# Note: if you encounter any issues with the installation with permission denied +# for the backing storage, please try to check ACL permissions with getfacl -e +# $HOME/.local and eventually fix them with setfacl -m u:qemu:rx $HOME/.local +virt-install --connect="qemu:///system" --name="${VM_NAME}" --vcpus="${VCPUS}" --memory="${RAM_MB}" \ --os-variant="fedora-coreos-$STREAM" --import --graphics=none \ --disk="size=${DISK_GB},backing_store=${IMAGE}" \ --network bridge=virbr0 "${IGNITION_DEVICE_ARG[@]}" -- cgit v1.2.3