How to Run OSX on Gnome Boxes (KVM)


First, create an empty hard drive image:

qemu-img create -f qcow2 OSX.img 64G

Copy the BIOS enoch_rev2848_boot on the same folder where you created the HD.

Change QEMU parameters adding the OSK key on “-device isa-applesmc,osk=”add your osk1 and osk2” (The AppleSMC device needs a valid OSK key to function).
Change also the path of MacHDD and MacDVD.

Install OSX running QEMU:

qemu-system-x86_64 -enable-kvm -m 8192 -cpu Penryn,vendor=GenuineIntel \
-machine pc-q35-2.4 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-mouse \
-device isa-applesmc,osk="add your osk1 and osk2" \
-kernel ./enoch_rev2848_boot \
-smbios type=2 \
-device ide-drive,bus=ide.2,drive=MacHDD \
-drive id=MacHDD,if=none,file=./OSX.img \
-monitor stdio \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16 \
-spice port=5930,disable-ticketing
-device ide-drive,bus=ide.0,drive=MacDVD \
-drive id=MacDVD,if=none,snapshot=on,file=./'MacOSX_Mavericks.iso'

Warning: Mouse is not working fine. Be patient, we will install the driver at the end!

When you have the OSX installed and running, create the libvirt xml file called OSX.xml. Remember again to change path and OSK string.

<domain type='kvm' xmlns:qemu=''>
  <description># echo 1 &gt; /sys/module/kvm/parameters/ignore_msrs</description>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>2</vcpu>
    <type arch='x86_64' machine='pc-q35-2.4'>hvm</type>
      <hidden state='on'/>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Penryn</model>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='home/public/VMs/OSX/OSX.img'/>
      <target dev='sda' bus='sata'/>
      <boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
    <interface type='bridge'>
      <source bridge='virbr0'/>
      <target dev='tap0'/>
      <model type='e1000-82545em'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    <input type='mouse' bus='usb'/>
    <input type='keyboard' bus='usb'/>
    <graphics type='spice' autoport='yes' listen=''>
      		<listen type='address' address=''/>
      <clipboard copypaste='yes'/>
    <sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='none'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-applesmc,osk=add your OSK1 and OSK2'/>
    <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='Penryn,vendor=GenuineIntel'/>

Import VM to Gnome Boxes:

virsh create OSX.xml


You can now run your OSX from Gnome Boxes and install QemuUSBTablet for mouse and VoodooHDA for audio.

After installed QemuUSBTablet, change VM setting like this:

    <input type='tablet' bus='usb'/>


Inside the VM create a file named org.chameleon.boot.plist with the chameleon conf.:

sudo pico /Extra/org.chameleon.boot.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Graphics Mode</key>

If APP store is not working and you are able to browse on internet, probably the reason is that your ethernet device is not called “en0”.

Delete all network devices you have:


then delete these files:

cd /Library/Preferences/SystemConfiguration/
sudo rm preferences.plist
sudo rm NetworkInterfaces.plist

reboot and check if your ethernet device is now “en0”:




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s