git clone kholia-OSX-KVM_-_2018-08-13_13-33-54.bundle -b master
Run El Capitan, macOS Sierra, High Sierra and Mojave on QEMU/KVM. No support is provided at the moment.
For macOS High Sierra, follow README.md for High Sierra.Consult this document for debugging and general tips.
See the debugging section belowand closed issues before opening a new issue.
Host System Details
Known to work on:
Ubuntu 15.10 running on i5-6500 CPU.
Ubuntu 16.10 running on i7-3960X CPU.
Fedora 24 running on i5-6500 + i7-6600U CPU.
Tested with QEMU 2.4.1, 2.5, 2.6.1, and 2.8.
AMD CPU(s) are known to be problematic. AMD FX-8350 works but Phenom II X3 720does not. A CPU with SSE4.1 support is required for macOS Sierra.
Intel VT-x / AMD SVM is required.
Preparation steps on your current OS X / macOS
Download OS X El Capitan or macOS Sierra installer from Apple App Store.
Clone this repository. Files included in this repository are needed for ISOcreation.
git clone https://github.com/kholia/OSX-KVM.git
Run the ISO creation script
create_install_iso.shincluded in thisrepository. Run it with
This script supports specifying the path to OS X / macOS installationapplication manually via the
Copy the generated ISO from your Mac to your QEMU/KVM machine.
Preparation steps on your QEMU system
Clone this repository again on your QEMU system. Files from this repository are used in the following steps.
Install QEMU and other packages.
sudo apt-get install qemu uml-utilities virt-manager
See networking notes to setup guest networking.
Create a virtual HDD image where the OS X operating system will be installed.If you change the name of the disk image from
mac_hdd.imgto somethingelse, the boot scripts will need updating to point to the new image name. Abase install of OS X needs 10 GiB of space. Adding Xcode or other largesoftware obviously increases that requirement.
qemu-img create -f qcow2 mac_hdd.img 64G
Now you are ready to install OS X / macOS.
To install OS X, you can use the included
boot-macOS.sh script for a moresolid alternate to the following
virsh method. Use either the
boot-macOS.shmethod or the following
virsh / virt-manager method to install OS X / macOS.
virt-manager method is no longer recommended, and no support isprovided for it.
macOS-libvirt.xmlfile and change file paths for
Install_OS_X_10.11_El_Capitan.iso(bootable ISO image) and
Create a VM by running the following command```bashvirsh --connect qemu:///system define macOS-libvirt.xml
Start the VM in virt-manager and hit return in the console window.
After booting, the initial language selection should show up.
After selecting the language, fire-up the Disk Utility ...
... and initialize the new harddisk. If this step fails and the menu barshows "Language Chooser" then see the Debugging section below.
- After disk initialization, open a terminal window (in the Utilities menu) and recursively copy the /Extra folderto the newly initialized target volume using
bashcp -av /Extra "/Volumes/NewVolumeName"
When done, quit Terminal.
Now, you can continue with the installation as usual
When finished, the VM will reboot automatically and the first time setup continues as usual.
boot*.shscripts have the installation ISO listed in them but this isonly required for installation. Once installation is complete, comment outthe
-drivelines referring to MacDVD and the installation ISO.
Inside the guest, you may modify the
/Extra/org.chameleon.Boot.plistfileto change the default resolution of the virtual screen. See notesfor instructions on how to do this and some limitations on the resolutionchoices.
Download a Chameleon wizard such as Chameleon Wizard or Champlist in order togenerate a usable smbios.plist. This file goes into
/Extraand can be usedto assign a reasonable serial number to your virtual Mac. Generating this filesometimes fixes software incompatibilities that occur when the software can'tdetermine what Apple hardware it is running on.
For better mouse behavior, install https://github.com/pmj/QemuUSBTablet-OSX andconfigure QEMU to use the "usb-tablet" absolute pointing device.
To get sound on your virtual Mac, see the "Virtual Sound Device" in notes.
For macOS Sierra change the CPU model from
boot-macOS.shscript already has this change.
While booting from the macOS Sierra ISO installer, you might get stuck on the"Language Chooser" menu bar (with no option to launch Disk Utility). Thesolution is to use Ctrl+F2 and arrow keys to navigate the "macOS Installer"menu bar, and to launch the "Disk Utility".
An alternate solution is to type
Superis the Maccommand/clover key next to the
Altkey). Type this sequence multiple timesuntil a terminal window opens up. In the termianl window type:
This will generate a list of all attached disks. Look for the disk with asize similar to the
mac_hdd.imgcreated in an earlier step. Once identified,note the disk number. Run a command to initialize the filesystem.
diskutil eraseDisk JHFS+
diskutil eraseDisk JHFS+ SYS disk2
Then select your language and click the forward arrow to move to the next step.
Host machine may need the following tweak for this to work,
echo 1 > /sys/module/kvm/parameters/ignore_msrs
Type the following in the bootloader if the guest VM fails to boot (someolder ISO images may require this),
If you see "hdiutil: attach failed - Resource busy" error message during theISO creation step, quit the "Install macOS Sierra" program and unmount(eject) the "Install macOS Sierra" device. Disk Utility can help forunmouting disk images.
$ hdiutil info$ hdiutil detach /dev/disk2 # or something similar
If the App Store doesn't work, check the notes file for instructions on how to solve this.
If you are getting "DontStealMacOS" related errors, see
Building QEMU(recommended option) and
FakeSMC installationsections in notes file.
If the boot process is getting stuck on the Apple logo, upgrade your hostkernel and QEMU. For example, Linux 3.16.x from Debian 8 is known to beproblematic, whereas Linux 4.9.x with QEMU 2.8.x works fine on the samedistribution.
Is This Legal?
The "secret" Apple OSK string is widely available on the Internet. It is also included in a public court document available here. I am not a lawyer but it seems that Apple's attempt(s) to get the OSK string treated as a trade secret did not work out. Due to these reasons, the OSK string is freely included in this repository.
Gabriel Somlo also has some thoughts on the legal aspects involved in running macOS under QEMU/KVM.
http://forge.voodooprojects.org/p/chameleon/source/changes/HEAD/ (Enoch source)
Upload date: 2015-11-06
- 2018-08-13 13:33:54
- Internet Archive Python library 1.7.7
- iagitup - v1.0