forked from kholia/OSX-KVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macOS-HS-libvirt.xml
175 lines (161 loc) · 6.99 KB
/
macOS-HS-libvirt.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!--
macos High Sierra libvirt XML configuration.
Run "virt-xml-validate macOS-HS-libvirt.xml" to validate this file.
You may hot-redirect USB with ease from GNOME Boxes and other goodies.
To install this file, you may place it at ~/.config/libvirt/qemu/
and run: virsh define macOS-HS-libvirt.xml.
This configuration has been tested in Fedora 27 with stock QEMU-KVM.
Move/rename images and loader/nvmram files and paths as you wish.
Don't forget to replace CHANGEME with your values.
Replace gnome-boxes path with libvirt path if you don't use it.
Adjust memory and currentMemory to 3145728 if you want only 3 GiB.
Consider removing some cpu features if your hardware lacks support.
Replace spice with vnc if you prefer it.
Current network configuration is a local bridge (192.157.12x.x).
Change it to if you prefer a public bridge instead:
Change interface to <interface type='user'>
and remove the <source bridge='virbr0'/>
Or use virt-manager to edit this line instead of virsh edit.
Note: Default configuration caused severe clock problems
under Fedora 27 w/ i7-5820K. This is because Darwin uses
tsc (time since last tick) for time, and for me did not
fall back to rtc in the event of a clock mismatch with
libvirt's default time source. Therefore we must explicitly
give the clock a tsc timer for kvm to pass to the guest.
See comments on the <kvm> and <clock> attributes.
-->
<name>macos-high-sierra</name>
<uuid>2aca0dd6-cec9-4717-9ab2-0b7b13d111c3</uuid>
<title>macOS High Sierra</title>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-2.11'>hvm</type>
<loader readonly='yes' type='pflash'>/home/CHANGEME/macOS/OVMF_CODE.fd</loader>
<nvram>/home/CHANGEME/macOS/OVMF_VARS.fd</nvram>
</os>
<features>
<acpi/>
<!-- Note: On Fedora 27 w/ an i7-5820K CPU and repository QEMU version as of 27-Jan-2018, the guest experienced severe clock issues. If you encounter these issues, try changing this to <hidden state ='off'/> -->
<kvm>
<hidden state='on'/>
</kvm>
</features>
<!--
<cpu mode='custom' match='exact' check='full'>
<model fallback='forbid'>Penryn</model>
<vendor>GenuineIntel</vendor>
<feature policy='require' name='vme'/>
<feature policy='require' name='x2apic'/>
<feature policy='require' name='hypervisor'/>
<feature policy='require' name='invtsc'/>
<feature policy='require' name='aes'/>
<feature policy='require' name='xsave'/>
<feature policy='require' name='avx'/>
<feature policy='require' name='xsaveopt'/>
<feature policy='require' name='avx2'/>
<feature policy='require' name='smep'/>
<feature policy='require' name='vmware-cpuid-freq'/>
</cpu>
-->
<!-- Note: To resolve clock issues experienced on Fedora 27 as described at top of file,
we need to add a timer. Replace the clock offset line with,
<clock offset='utc'>
<timer name='tsc'/>
</clock>
Please remember to also change the kvm hidden state as well, as described above.
-->
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback'/>
<source file='/home/CHANGEME/.local/share/gnome-boxes/images/macos-high-sierra.qcow2'/>
<target dev='sda' bus='sata'/>
<boot order='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback'/>
<source file='/home/CHANGEME/.local/share/gnome-boxes/images/clover.qcow2'/>
<target dev='sdb' bus='sata'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pcie-root'/>
<controller type='pci' index='1' model='dmi-to-pci-bridge'>
<model name='i82801b11-bridge'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
</controller>
<controller type='pci' index='2' model='pci-bridge'>
<model name='pci-bridge'/>
<target chassisNr='2'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</controller>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:8e:e2:66'/>
<source bridge='virbr0'/>
<target dev='tap0'/>
<model type='e1000-82545em'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
</interface>
<input type='keyboard' bus='usb'>
<address type='usb' bus='0' port='2'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='tablet' bus='usb'>
<address type='usb' bus='0' port='3'/>
</input>
<input type='keyboard' bus='ps2'/>
<graphics type='spice' autoport='yes'>
<listen type='address'/>
</graphics>
<sound model='ich9'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
</sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='5'/>
</redirdev>
<hub type='usb'>
<address type='usb' bus='0' port='1'/>
</hub>
<memballoon model='none'/>
</devices>
<!-- Note: Enable the next line when SELinux is enabled -->
<!-- seclabel type='dynamic' model='selinux' relabel='yes'/> -->
<qemu:commandline>
<qemu:arg value='-device'/>
<qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='type=2'/>
<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:commandline>
</domain>