Pre-requisites:
1. A computer whose CPU supports hardware virtualization. You can check if your computer supports this by using CPUZ and check if your CPU supports VT-X instructions.
2. At least 3GB of RAM on host with at least 2GB of RAM allocated to VMWare image.
3. OS X 10.6.4 VMWare disk image which can be downloaded here
4. The latest iPhone SDK downloaded from here
5. A Windows tool to create ISO file, such as MagicISO or WinISO
6. A file splitter tool for Windows such as FFSJ or HJSplit
7. A file joiner tool for Mac such as Split&Concat, a port of hjsplit for Mac
Steps:
1. Download and start the VMX virtual machine.
The machine should boot up from the emulated CD-ROM, showing the Chameleon bootloader. Wait at least 15 seconds before pressing F5 and select the Apple icon to boot into Mac OS X from the virtual hard disk.

If you select the icon too soon, for some reason, the bootloader will not see the hard disk and you will be stuck at the loading screen forever. If VmWare reports no disk activity a few seconds after the loading screen comes up, reset the machine and try again. Try to wait longer and press F5 a few times before selecting the Apple icon.
2. Configure Mac OS X
The default language of the downloaded OS X image will be Russian. To change to English, you'll need to open the Preferences tab by clicking the top-left Apple logo and trying the various menu options until you get a panel that looks like the following:
Click on the International icon (it should be in the first row). After that, select English and drag it to the top of the list. It should look like the following:
After that, switch to Formats and Input menu and change everything to English (optional)
Disable Software Updates, Sleep (under Energy Saver), Screen Saver and Time Machine.
Also, go to Date & Time preferences, disable time synchronization and select a timezone so that the Mac system time is the same as what is displayed by Windows. This is needed because OS X assumes system time to be in GMT.
3. Increasing the hard disk size to 40 GB
The default hard disk size is too small (20GB) for the iPhone SDK. However, expanding the hard disk is not as simple as using VmWare to expand it to 40 GB and run Disk Utility to grow the partition. If you try it, you will get the "mediaKit reports partition map too small" error message. GParted also won't help as it can only shrink, not grow HFS+ partition.
I even tried to use CloneZilla to backup the original HFS+ partition from the 20GB hard disk, and restore it to the new HFS+ partition on the 40GB hard disk. This time, although Disk Utility shows the HFS+ partition size correctly as 40GB, Finder still reports the size as 20GB. Attempting to repair the disk under Disk Utility fails with error "invalid b-tree node size". A Google search suggests DiskWarrior which unfortunately does not boot up under VmWare using the Chameleon bootloader.
The solution (unbelievably simple) that I found was
a. Add a new virtual IDE (not SCSI) 40GB hard disk to the original OS X image.
b. Boot up from the original hard disk and use Disk Utility to create a single HFS+ partition on the 40GB hard disk.
c. Use Disk Utility to restore the original OSX partition to the newly created partition.
d. Shutdown OSX. Under the properties of the virtual machine, remove the newly created hard disk (not the image) and change the original hard disk to point to the new image.
e. Reboot. OSX should now see the hard disk as 40GB.
UPDATE: The above method takes a long time and does not always work. The proper method is to manually modify the partition table to reflect the new hard disk size. Run gpt tool from terminal as described in this post (see also this), destroy the existing partition table and recreate a new one with the correct partition size.
4. Getting the iPhone SDK installer on OSX
This is the tricky part. I have tried the following but failed:
a. Use Safari inside OS X to download the SDK.
For some reason the download was successful but the resulting DMG file was corrupted.
b. Download it under Windows to an external hard disk drive and use the Vmware's VM menu to map the drive to OS X.
OS X would recognize the file and seemed to be able to copy it over. The copy process however would hang Finder prematurely and I had to resort to a reboot.
c. Same as (b) but splitted the file to smaller parts before copying.
OS X would still hang while copying, no matter how small the size of each segment is. This seems to be a problem with how VmWare manages the hardware.
The solution I found is
a. On Windows, split the DMG file to many segments around 100 MB each using HJSplit/FFSJ.
b. Use MagicISO/WinISO to create an ISO file with all the splitted segments
c. Use VmWare to add a new virtual CD-ROM drive to the OS X which points to the ISO file.
d. Open the emulated drive in OS X and copy the segments over.
e. Finally, merge all the segments to create the installer DMG file.
5. Installing the iPhone SDK
This step is straight forward and should take around 30 minutes to 1 hour, depending on the speed of your computer.
That's all. You can now enjoy iPhone development on your PC. In my computer, I allocate 4GB of RAM to OSX and it's really fast. Except that there's no sound support, the rest is just fine:
I hope this guide will help those who want to develop iPhone apps but do not have a Mac. If you encounter problems setting up the virtual machine, refer to this post.


Hi,
ReplyDeleteCould you please in details explain how to perform each of these steps:
--------
Increasing the hard disk size to 40 GB
a. Add a new virtual IDE (not SCSI) 40GB hard disk to the original OS X image.
b. Boot up from the original hard disk and use Disk Utility to create a single HFS+ partition on the 40GB hard disk.
c. Use Disk Utility to restore the original OSX partition to the newly created partition.
d. Shutdown OSX. Under the properties of the virtual machine, remove the newly created hard disk (not the image) and change the original hard disk to point to the new image.
e. Reboot. OSX should now see the hard disk as 40GB.
--------
Especially a.
Thanks a lot!
Hi
ReplyDeleteFor (a), open the settings of the vmware virtual machine, select Hard disk and press Add. After that, select IDE. See the screenshot here: http://www.vladan.fr/wp-content/uploads/images/vmware-workstation-add-hard-disk.jpg
(b) and (c) is straightforward if you know how to use OSX Disk Utility.
Thank you, it works!
ReplyDeleteHi
ReplyDeleteDoes this work really? I' am sorry for a silly question, but I have tried many time to install iPhone SDK on Mac(in VMWare) and failed everytime. So I' am asking this before giving it a try because I don't want to loose my energy as I had lost previously.
Does the iPhone SDK will work just fine and I can build iPhone Apps in VMWare after following the above mentioned steps?
Looking forward to hear from you...
Thanks,
Thanks for your comment. You are right that the installation of Mac on VmWare will be very troublesome and time consuming if you have to do everything from scratch (e.g. setting up bootloader, partitioning, installing kext, ...). However, the image provided in this article will give you a full-working Mac OS 10.6.4 system under VmWare, so you won't have to go through the trouble installing one.
ReplyDeleteThe steps mentioned will only change the language from Russia to English (the original image is probably made by some Russian experts so the default language is Russian), and to copy the iPhone SDK onto the virtual machine. After that, everything should be straight forward.
As for performance, I would say it's perfect for iPhone development. There is no sound support and video emulation is a bit slow to play videos, but other than that, everything runs smoothly.
Try it and let me know the results. :)
Hi,
ReplyDeleteJust a quick question... :-)
I just come to hear that the above mentioned VMWare Image requires Core 2 Quad Processor.
Is that true? (Please! say it is just a rumor)... :-)
I have Dual Core 2.5 in my system with a Ram of 4 GB...
Looking forward to hear from you...
Thanks,
Imran Latif
Hi,
ReplyDeleteNo need for Core 2 Quad Processor. If you do not have such a powerful machine, just edit the VM settings and adjust the number of processors allocated to the virtual machine accordingly. I think it should work fine with just even 1 processor.
Working perfectly for iPhone app development.
ReplyDeleteI deployed to my physical iPhone for the sound since no sound support in the VMWare.
No problem with USB remoting to iPhone too.
One of the most hardware independent way to build a Hacktintosh.
Thank you MD for sharing!
Hi,
ReplyDeleteCould you please in details explain how to perform each of these steps:
--------
Increasing the hard disk size to 40 GB
a. Add a new virtual IDE (not SCSI) 40GB hard disk to the original OS X image.
b. Boot up from the original hard disk and use Disk Utility to create a single HFS+ partition on the 40GB hard disk.
c. Use Disk Utility to restore the original OSX partition to the newly created partition.
d. Shutdown OSX. Under the properties of the virtual machine, remove the newly created hard disk (not the image) and change the original hard disk to point to the new image.
e. Reboot. OSX should now see the hard disk as 40GB.
--------
Especially d.This part (change the original hard disk to point to the new image).
The steps should be clear enough if you are comfortable with using VMWare. Just edit the property of the virtual machines, and change the properties for the first hard disk. There is an option there to select which image is used)
ReplyDeleteI wish I would have found this site earlier... I just finished setting up my iphone development environment exactly as you described here, but I went through a lot of trouble to get all the pieces together. I found this same russian OS X VM Ware image floating around on some torrent and had to figure out how to change the language back to english by googling it around...
ReplyDeleteI also found an image of the iOS4 SDK via torrent... I am now a happy camper with my setup! Good luck to everyone trying to do the same, but it definitely works...
Glad you got it working. :) I also encountered a lot of problems and have to google around before I got it working. Hope my guide will help other people with similar problems.
ReplyDeleteHey, thanks for the tips. My problem was unrelated to what this guide is all about - basically i ran out of room on my Snow Leopard VM. this tutorial provided me with a simple way to expand the drive. Every other guide was aimed at fixing the issue using My Mac 10.6 install DVD.
ReplyDeletethis saved alot of hassles!
Hi TripleNine, glad you find my guide useful, cheers :)
ReplyDeleteHello, could u make video of step 3 "3. Increasing the hard disk size to 40 GB"and post on Youtube ? i try many time but it not working :(
ReplyDeletebest regards,