diff --git a/make.sh b/make.sh index 8495561..2fc5842 100755 --- a/make.sh +++ b/make.sh @@ -21,7 +21,8 @@ error() { } generate(){ - sed -e "s|VMDIR|$VMDIR|g" -e "s|MACHINE|$MACHINE|g" tools/template.xml.in > $OUT + UUID=$( cat /proc/sys/kernel/random/uuid ) + sed -e "s|VMDIR|$VMDIR|g" -e "s|UUID|$UUID|g" -e "s|MACHINE|$MACHINE|g" tools/template.xml.in > $OUT echo "$OUT has been generated in $VMDIR" } @@ -30,7 +31,7 @@ generate argument="$1" case $argument in -a|--add) - sudo virsh define $OUT + virsh -c qemu:///session define $OUT ;; -h|--help) print_usage diff --git a/tools/template.xml.in b/tools/template.xml.in index 321552f..87ad4b9 100644 --- a/tools/template.xml.in +++ b/tools/template.xml.in @@ -1,113 +1,113 @@ - + macOS-Simple-KVM - d06d502a-904a-4b34-847d-debf1a3d76c7 - 2097152 - 2097152 - 4 + UUID + macOS + 2097152 + 2097152 + 4 - hvm - VMDIR/firmware/OVMF_CODE.fd + hvm + VMDIR/firmware/OVMF_CODE.fd VMDIR/firmware/OVMF_VARS-1024x768.fd - + - - - + + + - + - - - - + + + + destroy restart destroy - - + + /usr/bin/qemu-system-x86_64 - - - - -
+ + + + +
- - - - -
+ + + + +
- -
+ +
- - -
+ + +
- - -
+ + +
- - -
+ + +
- -
+ +
- - - - -
+ + + +
- - - + + + - - + + - -
+ +
+ + +
- -
- - - - + + + - -
+ +