Jump to content


Photo
- - - - -

Mac OS X in KVM


  • Please log in to reply
15 replies to this topic

#1 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 30 July 2009 - 04:50 PM

I guess some of you have already tried one of the cracked Mac OS X installer DVD or pre-installed vmware image. Even if you get it to work after tons of workarounds, the result is very slow and can easily break if you update things. However, someone wrote patches for Qemu + KVM so that you can run Mac OS X without any modification. It works by emulating the AppleSMC chip (you still need to provide the "secret hardware key" which I can't give you for legal reasons, you need to get it from your own intel mac because you're supposed to own one anyway to do it legally).

I was able to get it to boot, but then I get a kernel panic:

Posted Image

Anybody has ideas of what is wrong? Anybody got it working? I'd love to get it working full speed without any workarounds :)

Guides:

http://alex.csgraf.de/self/
http://d4wiki.goddam..._Mac_OSX_on_KVM

Follow the instructions closely, they are all very important. Even if I do get a kernel panic, I know that the AppleSMC emulation is working (otherwise it wouldn't reach that point). There's something at the end of the wiki article that says press F8 when you boot and then enter code e0 to boot from cdrom, do it, otherwise it won't work and you'll get a nasty file not found error for some boot.plist file. Check the debug output in the terminal to make sure that the AppleSMC emulation key is correct. If anybody has it working, I'd like to know which version of OS X you used, and what you used to convert from .dmg to .iso

P.S.: For the hardware key, google "OSK0 OSK1" and you'll find more information about it from the qemu-devel mailing list. A hexadecimal to ASCII converter helps. If it looks like a poem, you're on the right track.

#2 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 30 July 2009 - 04:54 PM

(The above post was restored from the google caches)

In the meantime, I got a little further. You need to remove AppleIntelCPUManagement.kext from the installer DVD in order to avoid the kernel panic. Now, it does work, but the mouse and keyboard are really laggy and messed up. I've googled about it and it looks like the Qemu emulated keyboard and mouse are not well supported, and a way of getting things working fine is to use the VNC server from Mac OS X to remotely connect to the virtual machine (this requires some work to get bridge between the virtual machine and the local machine). The VNC session is supposed to work fine.

#3 Ohm

Ohm

    I could have written a book with all of these posts

  • Members
  • 3,209 posts
  • Gender:Male
  • Location:Maine, USA

Posted 30 July 2009 - 05:04 PM

How well does the OS itself run? Is it usable?

#4 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 30 July 2009 - 05:16 PM

How well does the OS itself run? Is it usable?


The OS itself runs properly. In between usage of the crappy mouse and keyboard, it was impressively fast. If what I read on a forum about using Mac OS X's VNC server to get around the bad emulated mouse and keyboard support is correct, then I should have a perfectly fine Mac OS X virtual machine soon (I'm a bit busy, I need to study now, I'll work on it later).

The set of patches for Qemu solves most problems with emulating Mac OS X, except for the AppleIntelCPUPowerManagement.kext. You can either delete it from the installer DVD, or I also found a custom .kext on macosxhints.com that would simply disable the problematic kernel extension.

Modifying the iso requires some work, but here is how to do it in Linux (install the HFS+ tools first)
http://www.64lines.c...unting-hfs-plus

I *think* that 3D acceleration is not yet supported, however.

#5 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 30 July 2009 - 09:00 PM

So stupid, but just remove the -usb -usbdevice keyboard -usbdevice mouse from the arguments and it will use a PS/2 mouse and keyboard, which work really well. I don't know why the instructions on the wiki said to use the usb devices to make it work.

EDIT: Wait, that works for a system that is already installed, it doesn't seem to work when booting from the installer DVD :(

#6 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 30 July 2009 - 11:49 PM

So stupid, but just remove the -usb -usbdevice keyboard -usbdevice mouse from the arguments and it will use a PS/2 mouse and keyboard, which work really well. I don't know why the instructions on the wiki said to use the usb devices to make it work.

EDIT: Wait, that works for a system that is already installed, it doesn't seem to work when booting from the installer DVD :(


I found out why it worked with the PS/2 keyboard and mouse: PCWiz's vmware image has additional drivers installed. I'm working on adding those to my own installation. It'd be even nicer to add them to the install DVD :)

#7 R4p1d

R4p1d

    Hakker addict

  • Members
  • 840 posts
  • Country:
  • Gender:Not Telling
  • Location:Space

Posted 30 July 2009 - 11:57 PM


So stupid, but just remove the -usb -usbdevice keyboard -usbdevice mouse from the arguments and it will use a PS/2 mouse and keyboard, which work really well. I don't know why the instructions on the wiki said to use the usb devices to make it work.

EDIT: Wait, that works for a system that is already installed, it doesn't seem to work when booting from the installer DVD :(


I found out why it worked with the PS/2 keyboard and mouse: PCWiz's vmware image has additional drivers installed. I'm working on adding those to my own installation. It'd be even nicer to add them to the install DVD :)


Here you go buddy:

Posted Image

Edited by R4p1d, 31 July 2009 - 12:09 AM.


#8 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 31 July 2009 - 12:03 AM



So stupid, but just remove the -usb -usbdevice keyboard -usbdevice mouse from the arguments and it will use a PS/2 mouse and keyboard, which work really well. I don't know why the instructions on the wiki said to use the usb devices to make it work.

EDIT: Wait, that works for a system that is already installed, it doesn't seem to work when booting from the installer DVD :(


I found out why it worked with the PS/2 keyboard and mouse: PCWiz's vmware image has additional drivers installed. I'm working on adding those to my own installation. It'd be even nicer to add them to the install DVD :)


Here you go buddy:

Posted Image


In case you guys are wondering, R4p1d h4x3d my computer to steal my precious OS X virtual machine just as I was getting somewhere :(

Nah, seriously, that's some link I had given on IRC but had not posted yet. I'll post more later when I get more things working. The install fails at the end saying that it couldn't set the hard disk as a startup device, something you can safely ignore. But then when you reboot you hit some problems: the new installation has AppleIntelCPUManagement.kext, so you need to delete it, and then it's not over: you need to get the emulated PS/2 mouse and keyboard working as the emulated usb keyboard and mouse aren't working well. I'm working on the latter at the moment. It looks like PCWiz's vmware image had them already. It'd be nice to add the drivers to the installer DVD.

#9 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 31 July 2009 - 11:22 AM

I found out that iDeneb already has the latest updates, and comes with PS/2 keyboard and mouse drivers. While it's possible to run an almost vanilla Leopard with the patches, there are still annoying things that need to get fixed. I searched on forums about how to install the required .kext for the PS/2 keyboard and mouse, and it looks like that even if you get it working, it'll easily break when updating, so you fall pretty much in the same problem of using tons of workarounds just like with vmware images (not being able to update things without breaking your system).

If what you want is the purest OS X, you can still do it by deleting AppleIntelCPUManagement.kext each time it gets installed (may get reinstalled with updates) and then work your way with PS/2 drivers, or use a remote VNC session to avoid using the PS/2 drivers and make your virtual machine use the usb mouse and keyboard even if they're barely usable, but will be usable through VNC.

#10 NyCgEek

NyCgEek

    Will I break 10 posts?

  • Members
  • 2 posts
  • Gender:Male

Posted 18 September 2009 - 07:33 AM

Hi!

I tried to give an unmodified osx in kvm a chance, but it seems the patched rpm has been updated. The mac patches a gone, I think. Do you have an idea where to get the right rpm?

Best regards from Germany!

nycgeek

Edited by NyCgEek, 18 September 2009 - 07:43 AM.


#11 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 18 September 2009 - 07:49 AM

Hi!

I tried to give an unmodified osx in kvm a chance, but it seems the patched rpm has been updated. The mac patches a gone, I think. Do you have an idea where to get the right rpm?

Best regards from Germany!

nycgeek


Hi nycgeek,

I think the only distribution that has a package prepatched is OpenSuse 11 (according to the wiki article that shows how to patch it). You'll have to build it from source, after patching it.

http://d4wiki.goddam..._Mac_OSX_on_KVM

You will then need to modify your install DVD

#12 NyCgEek

NyCgEek

    Will I break 10 posts?

  • Members
  • 2 posts
  • Gender:Male

Posted 18 September 2009 - 08:07 AM

Hi!

Yes! Building from source is clear! I tried it. But the src.rpm is not cappable of mac anymore. It was updated on 14.9.2009 an today. The version in the repo is

[ ] kvm-88-7.7.src.rpm 14-Sep-2009 09:31 5.1M Mirrors Metalink
[ ] kvm-88-7.8.src.rpm 18-Sep-2009 03:12 5.1M Mirrors Metalink

After compiling there is no Mac architecture avaiable. Also building the mac-bios gives errors.

I think the "OLD" SRC.RPM whould help. But i dont know where to find it.

Best Regards!

nycgeek

...And i forget: Thank you for the very fast reply! :-)


Hi!

I tried to give an unmodified osx in kvm a chance, but it seems the patched rpm has been updated. The mac patches a gone, I think. Do you have an idea where to get the right rpm?

Best regards from Germany!

nycgeek


Hi nycgeek,

I think the only distribution that has a package prepatched is OpenSuse 11 (according to the wiki article that shows how to patch it). You'll have to build it from source, after patching it.

http://d4wiki.goddam..._Mac_OSX_on_KVM

You will then need to modify your install DVD


Edited by NyCgEek, 18 September 2009 - 08:10 AM.


#13 undertalk

undertalk

    the 0ne

  • Members
  • 1 posts
  • Gender:Male

Posted 12 May 2010 - 07:37 AM

I found out that iDeneb already has the latest updates, and comes with PS/2 keyboard and mouse drivers. While it's possible to run an almost vanilla Leopard with the patches, there are still annoying things that need to get fixed. I searched on forums about how to install the required .kext for the PS/2 keyboard and mouse, and it looks like that even if you get it working, it'll easily break when updating, so you fall pretty much in the same problem of using tons of workarounds just like with vmware images (not being able to update things without breaking your system).

If what you want is the purest OS X, you can still do it by deleting AppleIntelCPUManagement.kext each time it gets installed (may get reinstalled with updates) and then work your way with PS/2 drivers, or use a remote VNC session to avoid using the PS/2 drivers and make your virtual machine use the usb mouse and keyboard even if they're barely usable, but will be usable through VNC.


Hi Aghaster, great post, you saved me with the kernel panic I was having...
Are you still around? I'm installing and I'm having the same problems with kb/mouse. Can you give more details about this? Do you really have ps/2 kb/mouse or just the emulation works best? Which kext did you use? Thanks

EDIT: also, did your install really take 45min? mine estimates 7 hours! what parameters are you using to startup qemu?

Edited by undertalk, 12 May 2010 - 07:41 AM.


#14 Aghaster

Aghaster

    The Frenchman

  • Agents of the Revolution
  • 2,093 posts
  • Country:
  • Gender:Male
  • Location:Quebec, Canada

Posted 12 May 2010 - 09:49 PM


I found out that iDeneb already has the latest updates, and comes with PS/2 keyboard and mouse drivers. While it's possible to run an almost vanilla Leopard with the patches, there are still annoying things that need to get fixed. I searched on forums about how to install the required .kext for the PS/2 keyboard and mouse, and it looks like that even if you get it working, it'll easily break when updating, so you fall pretty much in the same problem of using tons of workarounds just like with vmware images (not being able to update things without breaking your system).

If what you want is the purest OS X, you can still do it by deleting AppleIntelCPUManagement.kext each time it gets installed (may get reinstalled with updates) and then work your way with PS/2 drivers, or use a remote VNC session to avoid using the PS/2 drivers and make your virtual machine use the usb mouse and keyboard even if they're barely usable, but will be usable through VNC.


Hi Aghaster, great post, you saved me with the kernel panic I was having...
Are you still around? I'm installing and I'm having the same problems with kb/mouse. Can you give more details about this? Do you really have ps/2 kb/mouse or just the emulation works best? Which kext did you use? Thanks

EDIT: also, did your install really take 45min? mine estimates 7 hours! what parameters are you using to startup qemu?


I think you should take a look at either the current beta of VirtualBox which supposedly supports Mac OS X now, otherwise it's possible to get an untouched OS X installation working in vmware with some effort (by first installing a cracked distro, and then installing the untouched version from the cracked distro to a second virtual hard disk).

#15 gsomlo

gsomlo

    the 0ne

  • Members
  • 1 posts
  • Gender:Male

Posted 30 September 2012 - 08:42 PM

If what you want is the purest OS X, you can still do it by deleting AppleIntelCPUManagement.kext each time it gets installed (may get reinstalled with updates) and then work your way with PS/2 drivers, or use a remote VNC session to avoid using the PS/2 drivers and make your virtual machine use the usb mouse and keyboard even if they're barely usable, but will be usable through VNC.


I'm trying to reproduce these results, and the furthest I got was with this list of steps:

1. install suse 11.3, and bring all packages up to date for that version of the distro
2. replace kvm kmods with kvm-kmod-3.6.38.6, patched with kmod patches from https://github.com/s...-osx-on-kvm.git
3. mount lion install "iso" image on my Mac, delete AppleIntelCPUManagement.kext, unmount/"eject", copy "doctored" install image to Linux
4. run this: qemu-kvm -M mac -osk "our...Inc" -m 2048 -cpu core2duo -hda ./mac_hdd.img -usb -usbdevice mouse -usbdevice keyboard -bios bios-mac.bin -kernel ./Chameleon_RC5_Trunk_Binaries_r668/i386/boot -drive id=cdrom,file=./mod_leopard.iso -monitor stdio

where mac_hdd.img is an empty qcow2 image created with qemu_img, and mod_leopard.iso is my "doctored" DVD install image sans the AppleIntelCPUManagement.kext.

I get to the desktop wallpaper and a spinning beach ball, but no further than that. Does anyone on this forum who did get this to work in the past have a command line laying about they'd be willing to share ?

#16 tekio

tekio

    5(R1P7 |<1DD13

  • Binrev Financier
  • 1,095 posts
  • Gender:Male
  • Location:The Blue Nowhere

Posted 01 October 2012 - 01:14 AM


If what you want is the purest OS X, you can still do it by deleting AppleIntelCPUManagement.kext each time it gets installed (may get reinstalled with updates) and then work your way with PS/2 drivers, or use a remote VNC session to avoid using the PS/2 drivers and make your virtual machine use the usb mouse and keyboard even if they're barely usable, but will be usable through VNC.


I'm trying to reproduce these results, and the furthest I got was with this list of steps:

1. install suse 11.3, and bring all packages up to date for that version of the distro
2. replace kvm kmods with kvm-kmod-3.6.38.6, patched with kmod patches from https://github.com/s...-osx-on-kvm.git
3. mount lion install "iso" image on my Mac, delete AppleIntelCPUManagement.kext, unmount/"eject", copy "doctored" install image to Linux
4. run this: qemu-kvm -M mac -osk "our...Inc" -m 2048 -cpu core2duo -hda ./mac_hdd.img -usb -usbdevice mouse -usbdevice keyboard -bios bios-mac.bin -kernel ./Chameleon_RC5_Trunk_Binaries_r668/i386/boot -drive id=cdrom,file=./mod_leopard.iso -monitor stdio

where mac_hdd.img is an empty qcow2 image created with qemu_img, and mod_leopard.iso is my "doctored" DVD install image sans the AppleIntelCPUManagement.kext.

I get to the desktop wallpaper and a spinning beach ball, but no further than that. Does anyone on this forum who did get this to work in the past have a command line laying about they'd be willing to share ?

Are you referring to OS X in a virtual machine on a Suse host? This thread is pretty old. When it was started some people were still running Tiger.

Now, there are pre-made VMware and Virtual Box images that work right off the bat.




BinRev is hosted by the great people at Lunarpages!