Skip to content

Instantly share code, notes, and snippets.

@sergeycherepanov
Last active April 28, 2022 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sergeycherepanov/8a709429e72d02cc4da6c17593f09214 to your computer and use it in GitHub Desktop.
Save sergeycherepanov/8a709429e72d02cc4da6c17593f09214 to your computer and use it in GitHub Desktop.
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!--
DONT FORGET TO ADD: /vm/osx-ovmf-bios-src-build/bios.bin IN APPARMOR PROFILE!
Host machine may need the following tweak for this to work, (it's will be reset after reboot)
echo 1 > /sys/module/kvm/parameters/ignore_msrs
Usb stick image with installer http://bit.ly/2dIhdy8
Archive with bioses: http://bit.ly/2djSmxR
QEMU CLI RUN:
qemu-system-x86_64 \
\
-rtc clock=vm,base=2016-01-01T16:01:21 \
\
-m 4096 \
-enable-kvm \
-cpu core2duo,vendor=GenuineIntel \
-rtc base=localtime \
-smbios type=2 \
-machine q35,accel=kvm,usb=off,vmport=off \
-bios /vm/osx-ovmf-bios-src-build/bios.bin \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
\
-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
-device ahci,id=sata0,bus=pci.2,addr=0x5 \
\
-drive file=/vm/img/osx-el-capitan.img,if=none,id=drive-sata0-0-2,format=raw \
-device ide-hd,bus=ide.2,drive=drive-sata0-0-2,id=sata0-0-2,bootindex=1 \
\
-drive file=/vm/drives/osx-vm0-disk0.qcow2,if=none,media=disk,id=drive-sata0-0-0,format=qcow2 \
-device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0 \
\
-usb \
-device usb-mouse \
-device usb-kbd \
-serial stdio \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16 \
-vnc 0.0.0.0:1
-->
<name>osx-capitan-0</name>
<uuid>45581fa0-8747-11e6-abb5-901b0ea3c3cc</uuid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-2.4'>hvm</type>
</os>
<features>
<acpi/>
<kvm>
<hidden state='on'/>
</kvm>
</features>
<cpu mode='custom' match='exact'>
<model fallback='allow'>core2duo</model>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/vm/img/osx-el-capitan.img'/>
<backingStore/>
<target dev='sda' bus='sata'/>
<alias name='sata0-0-0'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/vm/drives/osx-vm0-disk0.qcow2'/>
<backingStore/>
<target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<interface type='network'>
<source network='default'/>
<model type='e1000-82545em'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
</interface>
<input type='tablet' bus='usb'>
<alias name='input0'/>
</input>
<input type='mouse' bus='usb'/>
<input type='keyboard' bus='usb'/>
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<video>
<model type='vga' vram='67108864' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>
<memballoon model='none'/>
</devices>
<qemu:commandline>
<qemu:arg value='-device'/>
<qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
<qemu:arg value='-bios'/>
<qemu:arg value='/vm/osx-ovmf-bios-src-build/bios.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='type=2'/>
<qemu:arg value='-k'/>
<qemu:arg value='en-us'/>
<qemu:arg value='-cpu'/>
<qemu:arg value='core2duo,vendor=GenuineIntel'/>
</qemu:commandline>
</domain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment