UPDATE 2011.07.06
ERROR: the cpu has been disabled by the guest operating system
I got this error with my new i7 2600 and the fix is to add this line to your .vmx file:
cpuid.1.eax = “0000:0000:0000:0001:0000:0110:1010:0101″

I don’t have this problem on my last gen i5 which is weird. So it must be the newer socket type / sandy bridge cpus. OSX Lion, may not have this issue, we will see soon enough.

Developing for the iPhone and iPad by runing OS X 10.6 Snow Leopard on a PC

If your looking to get a taste of the OSX environment for what ever reason, be it iPhone or iPad development, or even if like me your a Brisbane Web Design who yearns for a unix system with photoshop out of the box and even steam game support, then there are a few options.

After all you cant compile iphone apps on PC, theres no good toolchain since firmware version 1, and unless your a pro linux hacker who writes apps for cydia chances are you dont know the first thing about GCC and tool chains. I certainly do not.

You could buy a mac, but chances are if you’re reading this article you don’t want to.

Firstly, getting OS X

Installing OS X Snow Leopard Hackintosh Style

The best method available to date is TonyMacs iBoot.

http://tonymacx86.blogspot.com/2010/04/iboot-multibeast-install-mac-os-x-on.html

iBoot is basically a blank CD that lets you bootstrap a retail DVD and install it hassel free.

Once installed the MultiBeast Tool from TonyMac helps you find drivers or kexts and install those.

One thing to be careful of is the use of Intel i5′s and i7′s. They werent supported by the vanilla (the unmodified apple) kernel of OSX until 10.6.3, so you may need to boot a non vanilla kernel such as Chocolate Kernel (love the humour of the programming community) and then patch to the latest version to get your hackintosh running tasty vanilla kernel on your super sweet i5.

A note on Patching, I installed the 10.6.5 patch to my VM this morning and it worked flawlessly, so its likely to be just as smooth on a hackintosh.

The Steps in Order:

  1. get iBoot and burn to a CD
  2. read the instructions, then read them again, if your having trouble there is probably a solution but you need to understand why its not working so you can Google the right answer :)
  3. install osx
  4. update osx, the latest version is 10.6.5
  5. get MultiBeast and go get all the drivers you need for your hardware, you might not get everything working flawlessly

But for iPhone Development all you need really is network, keyboard and mouse and decent resolution for your monitor. I installed it this morning 11/11/2010 and it works flawlessly

Install OSX hackintosh style, meaning its running on your PCs bare metal booting natively.

I have done this both with Tiger back in the day using old school DD images and using Snow Leopard retail images and various usb methods.

Installing OSX Vmware Workstation Style

Crysis 2 Anyone? :)

1) install vmware 7.1

2) install vmware patch for osx guest

3) install osx

4) update osx, the latest version is 10.6.5 (I installed it this morning 11/11/2010 and it works flawlessly)

5) Get all your drivers, this is the hard part but searching these sites is your friend

For this I would strongly recommend these resources.

This used to be a pain in the ass. Seriously, it would require using a special darwin iso which was made to allow vmware to boot a darwin environment, which is the open source tree of freebsd / nextstep, and then jump across into osx.

The reason being, Apple in their ivory tower, dont want people running OSX as a guest in a Virtual Machine. VMWare have complied with Apples wishes and stripped from the PC version of their software the ability to run OSX as a guest.

Enter the h4x0r.

An epicly awesome coder going by Albert Nietsnie on the insanelymac forums posted this handy little fix for VMWare Workstation 7.1.
http://www.insanelymac.com/forum/index.php?showtopic=220750&mode=threaded&pid=1485873

What it does is patch VMWare to re-enable the OSX Guest capability. After all the coders at VMWare obviously decided that removing all the functionality from their code base would be more time consuming than simply nerfing the final binaries.

Once patched your in VMware heaven. You can pick OSX from the install process and have your VM installing and booting in no time.

The trick to getting your VMware install working smoothly is to install a few drivers and handly little utilities.

This guy is another hero of mine. zenith432 has helped create both VMware Video drivers and sound drivers so your OSX Guest VM can operate usably. http://sourceforge.net/projects/vmsvga2/

osx drivers vmsvga2 and ensoniqaudiopci

Install both of those and reboot, also make sure you tell VMware to add a Sound Device to your guest, and change it to use default host sound card.

This allows windows 7 to pipe the sound through Windows 7s Audio Mixer so you can play it with other audio. If you were to connect say a USB headset directly to the VM, you wouldn’t be able to share that with Windows, so no Winamp for you! :(

Vmware Tools and Unity

If you’re a VMWare Lover like me you’re thinking, Unity? Please? No sorry, You can install the VMWare Tools for OSX which come with VMware fusion.

Download VMWare Fusion and find the darwin.iso file and install them. They probably help something but you dont get the coolness of what VMWare tools would do if they were meant to allow OSX to run in Workstation.

No drag and drop files. No simply networking folders. And no UNITY. :( . Hopefully that changes in the future.

Secondly, getting your iPhone Development Environment Cranking!

6) install caffine

7) change screensaver and power options to off

This is super important, for a long time I couldnt work out why my OSX Guest VM would crash from time to time.

Turns out its a power saving option which gets enabled, and then the VMware Workstation Host environment has trouble waking the machine out of sleep, probably because theres no proper ACPI drivers. Once Caffine is installed you can use it to ensure your machine never goes into sleep mode. Also make sure to turn off all power saving options in the Settings area of OS X. With this I have left my VMWare Guest running overnight and through the next day and its been ready and waiting still running when I returned.

8) install iphone dev tools. Go download xcode and the dev tools and install

9) install git

You are going to want GIT for pretty much any coding, if your more comfortable with SVN nows time to switch to GIT

I found this Crash Course on GIT for SVN users to be handy when I first got into GIT.

http://git.or.cz/course/svn.html

10) get doublecommand and swap keyboard keys

This will save your life, seriously. You will have a PC keyboard and everything will be confusing.

You want these options. Which will give you control c and control v, pc style home and end keys and the usual, control t and w for opening tabs in chrome and closing windows etc.

11) Understand PhoneGap (follow setup guide): http://phonegap.pbworks.com/Getting-Started-with-PhoneGap-(iPhone)

12) Follow steps to setup CSR: https://developer.apple.com/ios/manage/certificates/team/howto.action. Utilities > Keychain Access, Create CSR, upload CSR and approve via email

13) Go through each step on the left, find your uuid for your device and add it to the devices list.

I was a little scared when I got to this step, because my iPhone is Jailbroken and I thought, hell, I dont want to “RESTORE” my iPhone into “development mode”.

You don’t have to restore your iphone but just press the “use for development” button in the xcode organizer to allow developer provisioning to work.

14) Create an app, using the reverse domain name system

This was confusing at first, but best practise is a reverse domain like for example, kintek.com.au is our domain, so our reverse DNS is au.com.kintek

15) create a provisioning profile tieing a bunch of developers and devices to an app

Apparently this is easier in the new xcode organiser

16) in the project click target on the left, the info button on the top bar

17) change name in properties to match an existing app id domain

18) change build tab, provisioning profile to a matching profile

The most common problem when loading other peoples code is the build target. I dont know why but Apple removes the older build version code from xcode.

Hell I guess it keeps the file size down and considering xcode download is like 3 gb, thats certainly a valid decision, but apparently if you do want to compile for older versions you can get them from another install of xcode with that version and simply copy the files.

However as Apple tries to make super clear… You should be building for the latest firmware at all times. With older versions simply a compatibility concern.

I hope this guide has been useful, its taken me a long time to work out all these little kinks and I thought perhaps some other people might find this info valuable.

I know its been particularly helpful for testing a web design on an iDevice or checking location services for brisbane website designs.


  • http://www.gorgos.de gorgos

    Awesome guide. I have some additional tips. But I first Im gonna test your tips. Reporting back in a few days..

    • madhava

      Hi Gorgos,
      Looking forwards to hearing your feedback so I can compile this into an uber guide! :)

  • http://www.gorgos.de gorgos

    Well I see you really put all tips together. Any other guides out there are not even close to your guide in regards of good tips and tricks. Thanks. :)

    I was updating from 10.6.4 to 10.6.5 now. Somehow the update disabled usb mouse and keyboard support for me and I couldn’t find a way to fix it. But I am getting a new PC when Intel Sandy Bridge is released, so I’d have to reinstall it later anyway. I’m not in a hurry, so I just wait.

    For all .NET developers: MonoTouch. With the free evalutation version you can test it with full funtionalty but only for the iPhone Simulator. It was really fun since I actually hate XCode and love C#. Full version costs 400$.

    Also iSimulate is quite useful if you test in the iPhone Simulator. Just make sure you use a bridged network, so you can access it over your local wireless network.

    All in all it’s amazing how good you can configure your Mac OS X VM. I’d say a 600$ PC with Snow Leopard in Vmware correctly configured is faster than native Sl on a 700$ Mac Mini. Can’t wait to see how fast my VM gets, when I install it on SSD with the new Intel CPUs.

    P.S. Unity would be incredibly awesome but I dont think it will come ever.

    • madhava

      I agree.
      As soon as I get a bit more power, ill probably be running windows itself in a VM on a unix based desktop.
      Once you give more than 1 core and 512mb of ram to a VM and the drivers for video are working well, you have pretty much native performance, especially for anything thats not gaming. :)

      Im glad to hear this guide helped you. I will add some of your suggestions to this guide soon along with a few other improvements I have thought of.

      I cant quite get the best combo of key swapping with double command though, because I am used to Control + C in the command prompt on my windows machine but once I swap the keys around to make copy and paste and open and close tabs then I loose that in the command prompt. Its really annoying.

      I would love someone to make the perfect mapping for a Windows user.

  • Estades

    AMAZING Guide I wanted to develop for iPhone and this guide is perfect. I noticed too that if you don’t move your mouse pointer for too much time in VMware then the system freezes and you have to restart the machine to make it work again.

    1) By the way, can you post a link to Caffine I couldn’t find that.

    2) Also how do vmsvga2 works together with VMWare tools, I can actually run the Virtual Machine at 2560×1600 even if hardware acceleration isn’t available.

    3)I have a preinstalled OSX VMware image with a darwin.iso file that’s used as a boot loader, there is another one that contains VMWare Tools (I think that is the one from Fusion) what would change if I Try a new install using Albert Nietsnie patch. That would need the darwin.iso bootloader still to boot the OSX or VMWare EFI will be enough and I will get also better overall performance ? I have the SnowLeopard update DVD will it work without resorting to the darwin.iso boot loader ?

    4)When you say get all of your drivers, what should I get over the Audio Driver and vmsvga2, and what should I downoad.

    5) Why GIT is important doesn’t Xcode have any revision control ?

    Thanks for your time and I wait impatiently for your replies.

    • madhava

      Hi Estades,
      Firstly, thanks for the feedback. :)
      Let me answer your questions one at a time.

      1) Caffine for OSX
      http://www.apple.com/downloads/macosx/system_disk_utilities/caffeine.html

      That should stop the freezing issues, make sure its turned on so that it stops power saving feature, which is what happens if you dont move your mouse or do anything.

      2) vmsvga2 is a driver for OSX which supports the simulated hardware of VMware allowing it to work smoother and faster.
      3) If you patch your VMware to allow native osx booting you will no longer need the darwin.iso.
      The main advantage to this is its easier to setup new machines and is more likely to work with future updates.
      If you have a snow leopard disk I suggest you backup your VM, then patch vmware, create a new VM and install snow leopard from scratch under a proper OSX Guest. You can install full osx with an upgrade DVD. Google search to find out how. :)

      4) There is an audio driver on the same sourceforge page as the video driver vmsvga2 which allows you to get audio working properly. To do it you will need to add an “audio” device to your vm and then install the driver. That is the best way, rather than actually connecting your audio device to the vm (e.g. a usb headset). The reason why is, then Windows will treat the sound coming from OSX as sound coming from VMware and play it over windows 7 audio layer, allowing you to control the volume independantly in the task bar mixer and have other audio also playing over the same device in windows. Ala Winamp! :)

      5) GIT is the best versioning software available, if xcode has svn or git support its still just using those technologies so you still need to learn svn or git. I highly recommend you learn GIT as soon as possible, the sooner your versioning your code the sooner you will be able to do clean bug free team collaborated code. :)

      Good luck!

      And please let me know when you have done something I can see and I will give you some feedback.
      :)

  • Estades

    Having a problem here, after installing the 10.6.5 I loose DVD/CDROM device and I can’t intstall vmware tools so I reinstalled and copied VMWARE tools from the iso to the desktop then I installed 10.6.5, then vmware tools, sound drivers and graphics drivers. Still I loose DVD. How can I have it back again, has this thing happened to you ?

    • madhava

      Hi Estades,
      Yes I am seeing this same problem. Not sure what the solution is yet, but there are mounting software for isos on mac so you could always install that and simply copy the images over you want to mount.
      The vmware tools can be downloaded by getting vmware fusion from the vmware site on the mac and then finding the darwin.iso file after you install fusion. Then double clicking and installing those vmware tools.

  • airrun

    I’ve been experimenting with XCode in a VM hosted SnowLeopard all weekend and the performance is just terrible. It’s soul crushing waiting for everything to launch. Clicking on a nib is a good 2 minute wait for the Interface Builder to launch. I’ve given my VM 2 GB, turned off swapping in VM Workstation preferences, but nothing seems to help. I ran XBench, and the disk performance is single digit. The host computer is an I5 with a WD Black drive. It shouldn’t be this bad. I’m tempted to buy a SSD, but I’m not sure that would even help that much. Any advice? I’m tempted to just dual boot.

    PS Is it possible for the iPhone simulator to develop games with only the SVGA driver?

    • madhava

      Hi Airrun,
      Firstly, I have two setups, one is an i5 at home and the other just a core 2 duo at work, both run vmware fine. It sounds like something is wrong, its ever so possible it could be a virus scanner, I use Avast which seems to work fine, but I noticed on the weekend that Avast made it so I couldnt edit video in Adobe Premiere (just in windows) so I had to turn that off just to scrub the time line, so as I said its a possibility.

      So yeah you shouldnt need ssd to improve that situation. What resolution are you running it in? I think mine is like 1280×800, seems to run fine.

      Your second question about game development, well thats a good question. Im pretty sure Quartz doesnt run so its possible theres no open gl es support either, but having said that, considering the simulator is emulating ARM for the processor im sure its capable of doing software emulation of the powerVR graphics chip in the iphone as well, its not like its that powerful that software rendering isnt possible.

      Best way to test would be to load up a project with some open gl and test it, I know the Unity framework has a great 3d graphics engine for the iphone and probably has demo source code.
      http://unity3d.com/unity/features/iphone-publishing

      If you start down the iphone 3d gaming direction please let me know, im super interested.

      If you want super fast performance and native 3d graphics, why dont you just install osx on another partition or hdd. Follow the native install guide instead of vmware, theres tonnes of help out there, i suggest using something like the tonymacs iboot cd. I have a native install at home too and it runs super fast and 3d works on my nvidia 9600, but its just a pain having to boot into osx just to do something small and then reboot back into windows so the best option is either vmware or a second computer with a KVM. :)

      Hope that helps.

  • Orchid

    Hi there thanks for sharing the information for the Developing for the iPhone and iPad by runing OS X 10.6 Snow Leopard on a PC and its a nice and helpful to the iphone developer and PhoneGap is a framework which lets you do lots of interface coding in html5 instead of interface builder and If you familiar with Java you should have an easier time with Android development.

  • Danny

    The VM approach doesn’t work for me using VMWare Workstation 7.1.3. I’m trying in Windows 7 under Bootcamp on MacBook Pro, and when I start up the freshly created VM, just before installing the OS, I get a primitive screen saying, amongst other things:

    “Boot Failed. EFI DVD/CDROM”

    I’ve run Nietsni’s patch. Any ideas?

    • madhava

      Hi Danny,
      My only guess is that they have either intentionally or unintentionally changed the binary in the version you are using.
      I do believe that the patch does a byte search, so its probably an intentional change by VMWare.

      I am using version 7.1.0 build-261024 so if you can locate a download for that version it should work perfectly. :)

  • Iori Yagami

    Hello, thanks for the guide, this is exactly what I am searching for, but I need to know : does running OSX on the VMware need some hardware specificities?
    When I tried to install it, I got an error message : your hardware doesn’t support virtualization. Will I meet this message if I follow the steps you mentioned here?

    thanks,

    • madhava

      Hi Iori,
      Yes you need a CPU which supports virtualization extensions.
      http://en.wikipedia.org/wiki/X86_virtualization

      Either AMD-V or Intel VT-x, although iv only tested it with Intel chips and because OSX is built for Intel chips you will have the best chance with an Intel chip.

      There are some non-vanilla kernels out there that support AMD and older AMD cpus but thats beyond the scope of this guide.

      The problem with non vanilla kernels is, installing them is a pain and usually means your installation process is different, additionally when the system updates they can often overwrite the kernel with a new vanilla one, breaking your system.

      It works fine on my Core 2 Duo E8200, and my i5 700 at home.
      You need OSX 10.6.3 or higher to properly support i5, so your best getting an install image that is at least 10.6.3.

      10.7 will be out in a few months and ill be redoing this guide to cover OSX 10.7 Lion.

  • vnwind

    Thanks for the guide, can’t wait to set one up soon

  • ze caximbo

    i have instaled all of this on virtual box and works fine. I have not tested if I can publish my app on Apple yet, but i’ll try. Has anyone tried and has been successfull?

    thks

    • madhava

      Yes, it works fine.
      I will post a new guide for OSX Lion shortly.
      I have it working almost puuurrfectly in VMWare.
      There is a virtualbox guide out there but its far more hacky.

      I havent seen any hard numbers on performance between the two, if OSX Guest on Windows was officially supported Vmware would be better for sure, due to the VMWare tools features like Unity, and drag and drop.

  • zuber

    Hi, I have a dell precision workstaion. It has a quad core xeon E5410 processor running at 2.33ghz and I have ram 3gig.

    Would this be ok to run OSX on. Also, would this in effect become a dedicated Hackintosh or will it be dual boot so that I can choose whether to boot into windows or mac?

    Sorry about the noobie questions… as I am a noob!

  • madhava

    1) PhoneGap is a framework which lets you do lots of interface coding in html5 instead of interface builder.

    2) I dont know what you mean by normal developer account. You either do or do not have an iphone development account. If you dont have one you cant sign and install apps, or download the sdk or read the documentation.

    I have a jailbroken iphone and it works fine with a legit license. I did manage to get xcode to install apps without a license at the start of the year via jailbroken access. Theres guides out there, but its a pain in the ass. $99 is not a lot of money at the end of the day.

    a) Works for me :)
    b) Mine is jailbroken and doesnt appear to be a problem. No one has ever been banned or bricked for being jailbroken and in fact the new DMCA in united states of america says that Jailbreaking for the purpose of changing carrier is now legal, so I doubt much will happen in the future to prevent people from using jailbroken devices, the best they can do is bring out updates which the hackers need to break again.

    c) Its all explained in the documentation when you create an app id in the developer center. Get your license and you will see what this means.
    d) When you plug in an iphone you can go to the Organizer in xcode and you can add that phone to your development license. If you dont have one you wont be able to.
    e) Again this is part of the process of making your app in xcode correctly reflect the new app id you have created in the development center. The documentation explains this in depth.
    f) We are web designers and developers in Brisbane. :) Where are you based?

  • madhava

    Fair enough, I didnt play much with a non developer account so I dont know the differences.
    If your a web developer you will probably have an easier time starting with something like PhoneGap. Obj-c is pretty difficult syntax to get used to, and most of the work is actually just cocoa methods, so its not so much obj-c as it is learning all of cocoa interface methods.

    If your familiar with Java you should have an easier time with Android development. I got a dev environment for Android setup pretty easily, theres some good guides out there.
    There is another patch coming for OSX 10.6.6 in a couple of days to enable the mac osx store, so ill let you know how that goes, and see if I can fix the DVD rom issue.

    Yeah Brisbane is nice, its a very relaxed city. Cant say I have been to Italy, or Sicily for that matter but I would love to! :)

    I will let you know when I can publicly show you some of the work we are doing.

    Ciao

We'd love to
hear from you

We've prepared a simple project planner to get started.

Lets get started

Or send us a
message

Phone: (07) 3878 1151

Address: Office 2, 59 Hardgrave Rd,
West End, Brisbane, 4101, QLD, Australia

  • This field is for validation purposes and should be left unchanged.
css.php