1
0
Fork 0
mirror of https://github.com/foxlet/macOS-Simple-KVM.git synced 2024-11-27 13:39:42 +01:00

Name with version, copy template, allow nested virtualization

This commit is contained in:
Kowalski Prime 2020-05-03 19:08:20 +02:00
parent 5924de1e05
commit bc47ea3cf4
No known key found for this signature in database
GPG key ID: C4E819BD2BC6233E
3 changed files with 24 additions and 17 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ BaseSystem.img
BaseSystem.dmg
BaseSystem.chunklist
template.xml
version

15
make.sh
View file

@ -26,8 +26,12 @@ error() {
}
generate(){
NAME="macOS"
if [[ -e version ]]; then
NAME="$NAME $(cat version)"
fi
UUID=$( cat /proc/sys/kernel/random/uuid )
sed -e "s|BOXESHOME|$BOXES_HOME|g" -e "s|QEMUHOME|$QEMU_HOME|g" -e "s|UUID|$UUID|g" -e "s|MACHINE|$MACHINE|g" -e "s|MACHINE|$MACHINE|g" tools/template.xml.in > $OUT
sed -e "s|BOXESHOME|$BOXES_HOME|g" -e "s|MACOSNAME|$NAME|g" -e "s|BOXESHOME|$BOXES_HOME|g" -e "s|QEMUHOME|$QEMU_HOME|g" -e "s|UUID|$UUID|g" -e "s|MACHINE|$MACHINE|g" -e "s|MACHINE|$MACHINE|g" tools/template.xml.in > $OUT
echo "$OUT has been generated in $VMDIR"
}
@ -41,11 +45,12 @@ install(){
cp -Zfu BaseSystem.img $BOXES_HOME
cp -Zfu ESP.qcow2 $BOXES_HOME
echo Coping OVMF_CODE.fd in $QEMU_HOME/firmware/
cp firmware/OVMF_CODE.fd $QEMU_HOME/firmware/
cp -Zfu firmware/OVMF_CODE.fd $QEMU_HOME/firmware/
echo Coping OVMF_CODE.fd in $QEMU_HOME/nvram/
cp firmware/OVMF_VARS-1024x768.fd $QEMU_HOME/nvram/
echo Adding template.xml to GNOME Boxes domain
virsh -c qemu:///session define $OUT
cp -Zfu firmware/OVMF_VARS-1024x768.fd $QEMU_HOME/nvram/
echo Copy template.xml to $QEMU_HOME
cp -Zfu template.xml $QEMU_HOME/macOS-Simple-KVM.xml
virsh -c qemu:///session define $QEMU_HOME/macOS-Simple-KVM.xml
}
generate

View file

@ -1,7 +1,7 @@
<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
<name>macOS-Simple-KVM</name>
<uuid>UUID</uuid>
<title>macOS</title>
<title>MACOSNAME</title>
<memory unit="KiB">4194304</memory>
<currentMemory unit="KiB">4194304</currentMemory>
<vcpu placement="static">4</vcpu>
@ -34,7 +34,7 @@
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" />
<driver name="qemu" type="qcow2" cache="writeback" io="threads" />
<source file="BOXESHOME/ESP.qcow2" />
<target dev="sda" bus="sata" />
<address type="drive" controller="0" bus="0" target="0" unit="0" />
@ -46,7 +46,7 @@
<address type="drive" controller="0" bus="0" target="0" unit="1" />
</disk>
<disk type="file" device="disk">
<driver name="qemu" type="raw" />
<driver name="qemu" type="qcow2" cache="writeback" io="threads" />
<source file="BOXESHOME/macOS.qcow2" />
<target dev="sdc" bus="sata" />
<address type="drive" controller="0" bus="0" target="0" unit="2" />
@ -88,9 +88,10 @@
<input type="keyboard" bus="usb">
<address type="usb" bus="0" port="2" />
</input>
<graphics type="spice" autoport="yes">
<listen type="address" />
<graphics type="spice">
<listen type="none" />
<image compression="off" />
<gl enable="no" />
</graphics>
<sound model="ich9">
<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0" />
@ -110,7 +111,7 @@
<seclabel type="dynamic" model="selinux" relabel="yes" />
<qemu:commandline>
<qemu:arg value="-cpu" />
<qemu:arg value="Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check" />
<qemu:arg value="Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,vmx=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check" />
<qemu:arg value="-device" />
<qemu:arg value="isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" />
<qemu:arg value="-smbios" />