Advertisement
Guest User

Untitled

a guest
Jan 26th, 2023
972
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.35 KB | None | 0 0
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  3. <!--
  4. macOS libvirt XML configuration.
  5.  
  6. Run "virt-xml-validate macOS-libvirt-Catalina.xml" to validate this file.
  7.  
  8. To install this file, you may place it at ~/.config/libvirt/qemu/
  9. and run: virsh define macOS-libvirt.xml.
  10.  
  11. This configuration has been tested in Ubuntu 20.04 with stock QEMU-KVM.
  12.  
  13. Move/rename images and loader/nvmram files and paths as you wish.
  14.  
  15. !!! Don't forget to replace carlito with your values !!!
  16.  
  17. Adjust memory and currentMemory to 3145728 if you want only 3 GiB.
  18.  
  19. Consider removing some cpu features if your hardware lacks support.
  20.  
  21. Replace spice with vnc if you prefer it.
  22.  
  23. Current network configuration is a local bridge (192.168.12x.x).
  24. Change it to if you prefer a public bridge instead:
  25. Change interface to <interface type='user'>
  26. and remove the <source bridge='virbr0'/>
  27. Or use virt-manager to edit this line instead of virsh edit.
  28.  
  29. Note: Default configuration caused severe clock problems
  30. under Fedora 27 w/ i7-5820K. This is because Darwin uses
  31. tsc (time since last tick) for time, and for me did not
  32. fall back to rtc in the event of a clock mismatch with
  33. libvirt's default time source. Therefore we must explicitly
  34. give the clock a tsc timer for kvm to pass to the guest.
  35. See comments on the <kvm> and <clock> attributes.
  36. -->
  37. <name>MacOS-youtube</name>
  38. <title>MacOS-youtube</title>
  39. <memory unit='KiB'>4194304</memory>
  40. <currentMemory unit='KiB'>4194304</currentMemory>
  41. <vcpu placement='static'>4</vcpu>
  42. <os>
  43. <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
  44. <!-- We don't need patched OVMF anymore when using latest OpenCore, stock one is okay -->
  45. <loader readonly='yes' type='pflash'>/home/carlito/OSX-KVM/OVMF_CODE.fd</loader>
  46. <nvram>/home/carlito/OSX-KVM/OVMF_VARS.fd</nvram>
  47. </os>
  48. <features>
  49. <acpi/>
  50. <apic/>
  51. </features>
  52. <clock offset='utc'>
  53. <timer name='rtc' tickpolicy='catchup'/>
  54. <timer name='pit' tickpolicy='delay'/>
  55. <timer name='hpet' present='no'/>
  56. </clock>
  57. <on_poweroff>destroy</on_poweroff>
  58. <on_reboot>restart</on_reboot>
  59. <on_crash>restart</on_crash>
  60. <devices>
  61. <emulator>/usr/bin/qemu-system-x86_64</emulator>
  62. <disk type='file' device='disk'>
  63. <driver name='qemu' type='qcow2' cache='writeback' io='threads'/>
  64. <source file='/home/carlito/OSX-KVM/OpenCore/OpenCore.qcow2'/>
  65. <target dev='sda' bus='sata'/>
  66. <boot order='2'/>
  67. <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  68. </disk>
  69. <disk type='file' device='disk'>
  70. <driver name='qemu' type='qcow2' cache='writeback' io='threads'/>
  71. <source file='/home/carlito/OSX-KVM/mac_hdd_ng.img'/>
  72. <target dev='vdb' bus='virtio'/>
  73. <boot order='1'/>
  74. </disk>
  75. <disk type="file" device="disk">
  76. <driver name="qemu" type="raw" cache="writeback"/>
  77. <source file="/home/carlito/OSX-KVM/BaseSystem.img"/>
  78. <target dev="vdc" bus="virtio"/>
  79. <boot order="3"/>
  80. </disk>
  81. <controller type='sata' index='0'>
  82. <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
  83. </controller>
  84. <controller type='pci' index='0' model='pcie-root'/>
  85. <controller type='pci' index='1' model='pcie-root-port'>
  86. <model name='pcie-root-port'/>
  87. <target chassis='1' port='0x8'/>
  88. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
  89. </controller>
  90. <controller type='pci' index='2' model='pcie-root-port'>
  91. <model name='pcie-root-port'/>
  92. <target chassis='2' port='0x9'/>
  93. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
  94. </controller>
  95. <controller type='pci' index='3' model='pcie-root-port'>
  96. <model name='pcie-root-port'/>
  97. <target chassis='3' port='0xa'/>
  98. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
  99. </controller>
  100. <controller type='pci' index='4' model='pcie-root-port'>
  101. <model name='pcie-root-port'/>
  102. <target chassis='4' port='0xb'/>
  103. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
  104. </controller>
  105. <controller type='pci' index='5' model='pcie-root-port'>
  106. <model name='pcie-root-port'/>
  107. <target chassis='5' port='0xc'/>
  108. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
  109. </controller>
  110. <controller type='pci' index='6' model='pcie-root-port'>
  111. <model name='pcie-root-port'/>
  112. <target chassis='6' port='0xd'/>
  113. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/>
  114. </controller>
  115. <controller type='pci' index='7' model='pcie-root-port'>
  116. <model name='pcie-root-port'/>
  117. <target chassis='7' port='0xe'/>
  118. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x6'/>
  119. </controller>
  120. <controller type='virtio-serial' index='0'>
  121. <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
  122. </controller>
  123. <controller type='usb' index='0' model='ich9-ehci1'>
  124. <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
  125. </controller>
  126. <controller type='usb' index='0' model='ich9-uhci1'>
  127. <master startport='0'/>
  128. <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
  129. </controller>
  130. <controller type='usb' index='0' model='ich9-uhci2'>
  131. <master startport='2'/>
  132. <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
  133. </controller>
  134. <controller type='usb' index='0' model='ich9-uhci3'>
  135. <master startport='4'/>
  136. <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
  137. </controller>
  138. <!-- Make sure you put your nic in bus 0x0 and slot 0x0y(y is numeric), this will make nic built-in and apple-store work-->
  139. <interface type="bridge">
  140. <mac address="52:54:00:e6:85:40"/>
  141. <source bridge="br0"/>
  142. <model type="virtio"/>
  143. <address type="pci" domain="0x0000" bus="0x00" slot="0x00" function="0x0"/>
  144. </interface>
  145. <serial type='pty'>
  146. <target type='isa-serial' port='0'>
  147. <model name='isa-serial'/>
  148. </target>
  149. </serial>
  150. <console type='pty'>
  151. <target type='serial' port='0'/>
  152. </console>
  153. <channel type='unix'>
  154. <target type='virtio' name='org.qemu.guest_agent.0'/>
  155. <address type='virtio-serial' controller='0' bus='0' port='1'/>
  156. </channel>
  157. <graphics type='spice' autoport='yes'>
  158. <listen type='address'/>
  159. </graphics>
  160. <video>
  161. <model type="virtio" heads="1" primary="yes"/>
  162. </video>
  163. <!-- If you wanna passthrough GPU, make sure the gfx and audio are in the same bus (like 0x01) but different function (0x00 and 0x01)-->
  164. <!-- <hostdev mode='subsystem' type='pci' managed='yes'>
  165. <driver name='vfio'/>
  166. <source>
  167. <address domain='0x0000' bus='0x2d' slot='0x00' function='0x0'/>
  168. </source>
  169. <rom file='/mnt/disks/backups/BIOS/RX580/Ellesmere.rom'/>
  170. <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' multifunction='on'/>
  171. </hostdev>
  172. <hostdev mode='subsystem' type='pci' managed='yes'>
  173. <driver name='vfio'/>
  174. <source>
  175. <address domain='0x0000' bus='0x2d' slot='0x00' function='0x1'/>
  176. </source>
  177. <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
  178. </hostdev> -->
  179. <!-- If you wanna passthrough onboard audio(like 30:00.4), make sure you put it in bus 0x00 and slot 0x0y(y is numeric), otherwise AppleALC won't recognized it -->
  180. <!-- <hostdev mode='subsystem' type='pci' managed='yes'>
  181. <driver name='vfio'/>
  182. <source>
  183. <address domain='0x0000' bus='0x30' slot='0x00' function='0x4'/>
  184. </source>
  185. <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
  186. </hostdev> -->
  187. <memballoon model='none'/>
  188. </devices>
  189. <!-- Note: Enable the next line when SELinux is enabled -->
  190. <!-- seclabel type='dynamic' model='selinux' relabel='yes'/> -->
  191. <qemu:commandline>
  192. <qemu:arg value='-device'/>
  193. <qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
  194. <qemu:arg value='-smbios'/>
  195. <qemu:arg value='type=2'/>
  196. <qemu:arg value='-usb'/>
  197. <qemu:arg value='-device'/>
  198. <qemu:arg value='usb-tablet'/>
  199. <qemu:arg value='-device'/>
  200. <qemu:arg value='usb-kbd'/>
  201. <qemu:arg value='-cpu'/>
  202. <qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check'/>
  203. <!-- <qemu:arg value='Penryn,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2'/> -->
  204. <!-- If you wanna use cpu host-passthrough mode, uncomments below-->
  205. <!-- <qemu:arg value='host,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2'/> -->
  206. <!-- If you wanna use cpu emulating mode like Skylake-Server, uncomments below-->
  207. <!-- <qemu:arg value='Skylake-Server,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2'/> -->
  208. </qemu:commandline>
  209. </domain>
  210.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement