How to run MAC OS VM under KVM /qemu

From vpsget wiki
Revision as of 15:08, 11 August 2020 by Ndi (talk | contribs)
Jump to: navigation, search

//DRAFT We will show how to runMAC OS Virtual Machine under KVM /native qemu / This is only in educational purposes.

First of all you need to build your qemu from sources. Even if you have qemu/libvirt already installed our custom build should not conflict with it.

Check qemu module:

lsmod | grep kvm

if not listed add:

modprobe kvm

If you installing on environment that already using qemu/libvirt yo uneed to know where is qemu located in order to do not affect it:

whereis qemu
qemu: /usr/share/qemu

OK go to /opt and download qemu sources:

git clone git://git.qemu-project.org/qemu.git
cd qemu
git submodule init
git submodule update --recursive
git submodule status --recursive
git checkout stable-4.2  #or check what stable version exist at this time

Make sure you enabled APPLESMC in Makefile. Add if not exists the next records in Makefile :

# Makefile for QEMU. 
CONFIG_NE2000_ISA=y
CONFIG_HPET=y
CONFIG_APPLESMC=y

You may also check all APPLE related settings like with search:

grep "APPLE" -r .

Install gcc if not exists:

yum install gcc

..And dev tools if not installed:

yum groupinstall "Development Tools" 

Add depencies:

yum install glib2-devel  glibc-utils zlib zlib-devel pixman-devel


OK next configure to build qemu to custom binary

./configure --prefix=/usr/bin/qemundi 
make
  1. mkdir build
  2. cd build
  3. ../configure
  4. make