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:
parent
5924de1e05
commit
bc47ea3cf4
3 changed files with 24 additions and 17 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ BaseSystem.img
|
||||||
BaseSystem.dmg
|
BaseSystem.dmg
|
||||||
BaseSystem.chunklist
|
BaseSystem.chunklist
|
||||||
template.xml
|
template.xml
|
||||||
|
version
|
15
make.sh
15
make.sh
|
@ -26,8 +26,12 @@ error() {
|
||||||
}
|
}
|
||||||
|
|
||||||
generate(){
|
generate(){
|
||||||
|
NAME="macOS"
|
||||||
|
if [[ -e version ]]; then
|
||||||
|
NAME="$NAME $(cat version)"
|
||||||
|
fi
|
||||||
UUID=$( cat /proc/sys/kernel/random/uuid )
|
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"
|
echo "$OUT has been generated in $VMDIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,11 +45,12 @@ install(){
|
||||||
cp -Zfu BaseSystem.img $BOXES_HOME
|
cp -Zfu BaseSystem.img $BOXES_HOME
|
||||||
cp -Zfu ESP.qcow2 $BOXES_HOME
|
cp -Zfu ESP.qcow2 $BOXES_HOME
|
||||||
echo Coping OVMF_CODE.fd in $QEMU_HOME/firmware/
|
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/
|
echo Coping OVMF_CODE.fd in $QEMU_HOME/nvram/
|
||||||
cp firmware/OVMF_VARS-1024x768.fd $QEMU_HOME/nvram/
|
cp -Zfu firmware/OVMF_VARS-1024x768.fd $QEMU_HOME/nvram/
|
||||||
echo Adding template.xml to GNOME Boxes domain
|
echo Copy template.xml to $QEMU_HOME
|
||||||
virsh -c qemu:///session define $OUT
|
cp -Zfu template.xml $QEMU_HOME/macOS-Simple-KVM.xml
|
||||||
|
virsh -c qemu:///session define $QEMU_HOME/macOS-Simple-KVM.xml
|
||||||
}
|
}
|
||||||
|
|
||||||
generate
|
generate
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
|
<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
|
||||||
<name>macOS-Simple-KVM</name>
|
<name>macOS-Simple-KVM</name>
|
||||||
<uuid>UUID</uuid>
|
<uuid>UUID</uuid>
|
||||||
<title>macOS</title>
|
<title>MACOSNAME</title>
|
||||||
<memory unit="KiB">4194304</memory>
|
<memory unit="KiB">4194304</memory>
|
||||||
<currentMemory unit="KiB">4194304</currentMemory>
|
<currentMemory unit="KiB">4194304</currentMemory>
|
||||||
<vcpu placement="static">4</vcpu>
|
<vcpu placement="static">4</vcpu>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<devices>
|
<devices>
|
||||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
<disk type="file" device="disk">
|
<disk type="file" device="disk">
|
||||||
<driver name="qemu" type="qcow2" />
|
<driver name="qemu" type="qcow2" cache="writeback" io="threads" />
|
||||||
<source file="BOXESHOME/ESP.qcow2" />
|
<source file="BOXESHOME/ESP.qcow2" />
|
||||||
<target dev="sda" bus="sata" />
|
<target dev="sda" bus="sata" />
|
||||||
<address type="drive" controller="0" bus="0" target="0" unit="0" />
|
<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" />
|
<address type="drive" controller="0" bus="0" target="0" unit="1" />
|
||||||
</disk>
|
</disk>
|
||||||
<disk type="file" device="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" />
|
<source file="BOXESHOME/macOS.qcow2" />
|
||||||
<target dev="sdc" bus="sata" />
|
<target dev="sdc" bus="sata" />
|
||||||
<address type="drive" controller="0" bus="0" target="0" unit="2" />
|
<address type="drive" controller="0" bus="0" target="0" unit="2" />
|
||||||
|
@ -88,9 +88,10 @@
|
||||||
<input type="keyboard" bus="usb">
|
<input type="keyboard" bus="usb">
|
||||||
<address type="usb" bus="0" port="2" />
|
<address type="usb" bus="0" port="2" />
|
||||||
</input>
|
</input>
|
||||||
<graphics type="spice" autoport="yes">
|
<graphics type="spice">
|
||||||
<listen type="address" />
|
<listen type="none" />
|
||||||
<image compression="off" />
|
<image compression="off" />
|
||||||
|
<gl enable="no" />
|
||||||
</graphics>
|
</graphics>
|
||||||
<sound model="ich9">
|
<sound model="ich9">
|
||||||
<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0" />
|
<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0" />
|
||||||
|
@ -110,7 +111,7 @@
|
||||||
<seclabel type="dynamic" model="selinux" relabel="yes" />
|
<seclabel type="dynamic" model="selinux" relabel="yes" />
|
||||||
<qemu:commandline>
|
<qemu:commandline>
|
||||||
<qemu:arg value="-cpu" />
|
<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="-device" />
|
||||||
<qemu:arg value="isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" />
|
<qemu:arg value="isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" />
|
||||||
<qemu:arg value="-smbios" />
|
<qemu:arg value="-smbios" />
|
||||||
|
|
Loading…
Reference in a new issue