Compare commits
2 Commits
8c96623ad7
...
main
Author | SHA1 | Date | |
---|---|---|---|
46bbe1d5e9 | |||
b98f41512d |
@ -54,6 +54,15 @@ else
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Conditional variable assignment based on URI
|
||||
if [[ "$uri" == "qemu:///system" ]]; then
|
||||
disk_path="/var/lib/libvirt/images/"
|
||||
network_type="default"
|
||||
elif [[ "$uri" == "qemu:///session" ]]; then
|
||||
disk_path="$HOME/.local/share/libvirt/images/"
|
||||
network_type="user"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Display the selected option (optional)
|
||||
@ -113,6 +122,8 @@ virt-install \
|
||||
--input type=keyboard,bus=virtio \
|
||||
--input type=mouse,bus=virtio \
|
||||
--rng /dev/urandom,model=virtio \
|
||||
--iommu model=virtio \
|
||||
--memballoon none \
|
||||
--disk path="${disk_path}/${vm_name}.img",format=raw,bus=virtio,cache=writeback,size="$disk_size" \
|
||||
--location=https://download.fedoraproject.org/pub/fedora/linux/releases/42/Everything/x86_64/os/ \
|
||||
--initrd-inject ./dishes/"$vm_name".cfg \
|
||||
|
Reference in New Issue
Block a user