Mac OS X in QEMU emulator for Linux
Hello Khabrovites. Recently I needed to write Objective-C under Mac OS X. My hardware is not the most suitable for any builds, and religion does not allow me to sit completely in this OS. I decided to install Mac OS X on a Qemu virtual machine on Linux.
Here is a list of everything I used:
- Gentoo Linux 64 bit
- Qemu 0.10.5
- KVM (Kernel-based Virtual Machine) 88-r1
- KVM support in the Linux kernel
- Processor with Intel Virtualization Technology support (in my case it is Core2Duo E6400 )
- Linux kernel> = 2.6.20 -
Build Mac OS X iATKOS v7 (Leopard 10.5.7)
We proceed to the configuration, in the kernel you need to add KVM. Download the sources, unpack, run make menuconfig :
Processor type and features-> Paravirtualized guest support
Note:
- KVM paravirtualized clock
- KVM Guest support
- Paravirtualization layer for spinlocks
Next, a new Virtualization option appears in the root of the kernel settings.
We go there and check :
- Kernel- based Virtual Machine (KVM) support
- KVM for Intel processors support
- KVM trace support
- PCI driver for virtio devices
- Virtio balloon driver
We assemble, install, and reboot with the new kernel.
Now install Qemu with KVM support, and KVM itself
USE = "kvm" emerge qemu
emerge kvm
Now we turn to shamanism with a virtual machine.
Create a virtual hard disk:
qemu-img create -f raw macos.disk 30G
If we are going to run Qemu from outside the root, we need to give other users read / write permissions to the device / dev / kvm :
chmod 0666 / dev / kvm
Run:
kvm - boot d -hda macos.disk -m 900 -net nic, model = rtl8139 -net tap -usb -no-reboot -no-shutdown -vga std -cpu core2duo -cdrom 10.5.7.iso
-hda path to our virtual hard drive
-cdrom to the image
-no-shutdown -no-reboot is necessary so that in case of an error the emulator window “freezes” and you can read the error
-net nic, model = rtl8139 we emulate a Realtek 8139
-net tap network card so that the guest system can see the host host via the network with a TAP device
-m 900 the amount of memory given to the guest system
-boot d boot from sidiroma
-usb USB support
-cpu core2duo processor emulation Core2Duo
We load the disk. We mark the hard drive using Disk Utility (select from the menu above).
Driver settings.
Before you click Install, pay attention to the buttonCustomize
Things we need to choose:
x86 ACPI
Disabler
OHR
Remove TyMCE
CardBus
USB
Intel SATA / IDE
Kernels
Apple PS / 2
Can be installed. We are waiting for about 30 minutes.
Mac OS X is installed, customizable.
Now in the line to start, change -boot d to -boot c to boot from the hard drive.
We are loading. Now you need to come up with something with the network.
We search the Internet for PCGenRTL8139Ethernet.kext , install it, it is very easy to install using the kextinstaller program. While there is no network, you can transfer the necessary files to the system through a USB flash drive, for example, add -hdb / dev / sdb(path to the flash drive device)
Reboot the guest OS.
Now, in order for the Mac OS X network to work, you need to go into network management, select the Ethernet device, turn it off (Off), and then turn on and configure the desired IP (for example, 192.168.1.1), and in the host system, configure the device tap0:
ifconfig tap0 192.168. 1.2
That's basically it.

UPD The author of a post appeared on vinnishtein
Here is a list of everything I used:
- Gentoo Linux 64 bit
- Qemu 0.10.5
- KVM (Kernel-based Virtual Machine) 88-r1
- KVM support in the Linux kernel
- Processor with Intel Virtualization Technology support (in my case it is Core2Duo E6400 )
- Linux kernel> = 2.6.20 -
Build Mac OS X iATKOS v7 (Leopard 10.5.7)
We proceed to the configuration, in the kernel you need to add KVM. Download the sources, unpack, run make menuconfig :
Processor type and features-> Paravirtualized guest support
Note:
- KVM paravirtualized clock
- KVM Guest support
- Paravirtualization layer for spinlocks
Next, a new Virtualization option appears in the root of the kernel settings.
We go there and check :
- Kernel- based Virtual Machine (KVM) support
- KVM for Intel processors support
- KVM trace support
- PCI driver for virtio devices
- Virtio balloon driver
We assemble, install, and reboot with the new kernel.
Now install Qemu with KVM support, and KVM itself
USE = "kvm" emerge qemu
emerge kvm
Now we turn to shamanism with a virtual machine.
Create a virtual hard disk:
qemu-img create -f raw macos.disk 30G
If we are going to run Qemu from outside the root, we need to give other users read / write permissions to the device / dev / kvm :
chmod 0666 / dev / kvm
Run:
kvm - boot d -hda macos.disk -m 900 -net nic, model = rtl8139 -net tap -usb -no-reboot -no-shutdown -vga std -cpu core2duo -cdrom 10.5.7.iso
-hda path to our virtual hard drive
-cdrom to the image
-no-shutdown -no-reboot is necessary so that in case of an error the emulator window “freezes” and you can read the error
-net nic, model = rtl8139 we emulate a Realtek 8139
-net tap network card so that the guest system can see the host host via the network with a TAP device
-m 900 the amount of memory given to the guest system
-boot d boot from sidiroma
-usb USB support
-cpu core2duo processor emulation Core2Duo
We load the disk. We mark the hard drive using Disk Utility (select from the menu above).
Driver settings.
Before you click Install, pay attention to the buttonCustomize
Things we need to choose:
x86 ACPI
Disabler
OHR
Remove TyMCE
CardBus
USB
Intel SATA / IDE
Kernels
Apple PS / 2
Can be installed. We are waiting for about 30 minutes.
Mac OS X is installed, customizable.
Now in the line to start, change -boot d to -boot c to boot from the hard drive.
We are loading. Now you need to come up with something with the network.
We search the Internet for PCGenRTL8139Ethernet.kext , install it, it is very easy to install using the kextinstaller program. While there is no network, you can transfer the necessary files to the system through a USB flash drive, for example, add -hdb / dev / sdb(path to the flash drive device)
Reboot the guest OS.
Now, in order for the Mac OS X network to work, you need to go into network management, select the Ethernet device, turn it off (Off), and then turn on and configure the desired IP (for example, 192.168.1.1), and in the host system, configure the device tap0:
ifconfig tap0 192.168. 1.2
That's basically it.

UPD The author of a post appeared on vinnishtein