Building & installing your own OSx86 Leopard
Sun, Nov 4, 2007
Over the past week I became curious as to how difficult it would be to develop my own Leopard DVD to install on a regular PC which has been gathering dust for the past few months, so I decided to give it a shot. I did it mostly out of curiosity, since I already own an iMac and a MacBook Pro - both with Leopard installed using a family pack (thus I had three licenses to spare). It wasn’t really all that difficult to put together, but your mileage will vary pretty wildly depending on the kind of hardware you’re using. I should probably start this out with an obnoxious disclaimer:
Installing Mac OS X onto hardware not manufactured by Apple is a violation of the software’s EULA:
2. Permitted License Uses and Restrictions. A. This License allows you to install and use one copy of the Apple Software on a single Apple-labeled computer at a time. This License does not allow the Apple Software to exist on more than one computer at a time,and you may not make the Apple Software available over a network where it could be used by multiple computers at the same time. You may make one copy of the Apple Software (excluding the Boot ROM code) in machine-readable form for backup purposes only; provided that the backup copy must include all copyright or other proprietary notices contained on the original.
Violating a EULA is not illegal in most countries. Installing a copy of Mac OS X which you have not purchased most definitely is illegal in most countries.
Most of this guide is made using information supplied from all manner of places, this thread on the OSx86 Scene forums in particular. Why not just use the guide there you ask? Well, there are some things which are not explained very well and one or two things which are slightly inaccurate so hopefully this should be easier to follow. The files/shell scripts provided by BrazilMAC work great and form the basis for the scripts supplied with this guide. It should be noted that these files and shell scripts are largely taken from a Leopard patch which was leaked some months ago for earlier Leopard builds. I make no claim for having created these shell scripts, I’ve just made some minor changes and included some files necessary for making the drive bootable way easier. These files also originally came with assembler source to decrypt Leopard’s encrypted kernel - this can be found if you look hard enough (but is not required for what we’re doing here). With that out of the way and my shrink-wrapped copy of Leopard in hand, lets start.
Note: this entire guide assumes you have a Mac OS X installation available to you prior to actually installing Leopard on a regular home PC.
The files you’ll need - patch.zip
1. Preparing a disc image
Before we begin, we need to create a disc image of our original Leopard DVD. The Leopard DVD is a dual-layer DVD and since dual-layer media is still hideously expensive, we’re going to do some fiddling to reduce the size of our installer DVD down to 4.7GB so it will fit on a single layer DVD. Creating a disc image is really easy:
- Open up Disk Utility
- Select “Mac OS X Install Disc”
- Click the New Image button, leave the settings as they are, and save this disc image to your Desktop
This will take a little bit of time, so go grab a coffee while it’s doing its thing.
2. Patching our disc image
Right, we now have a disc image. Put this image on your Desktop if it isn’t there already.
- Place the contents “patch” (3 folders, 2 files) directory in the zip you downloaded earlier onto your Desktop
- Time for a little shell script editing. Open patch.sh in a text editor of your choice.
-
APDIR=/Users/YOUR_USERNAME/Desktop DMG="/Users/YOUR_USERNAME/Desktop/YOUR_DISC_IMAGE.dmg"
- Change YOUR_USERNAME to your account username under the Mac OS X install you’re currently in and change YOUR_DISC_IMAGE.dmg to the filename of your newly created Leopard image.
- We’re now ready to patch our disc image. Open up a terminal window.
- Run cd Desktop (you did remember to place the contents of the patch folder from the zip on your Desktop, right?)
- Run sudo ./patch.sh and enter your password.
- This will take a while, the shell script is going to first of all copy the contents of the DMG to an editable image for us, then it’ll remove unnecessary stuff to squeeze our DVD down to 4.7GB. It will also replace some kernel extensions as well as the installer DVD’s kernel itself. It’s worth noting that the kernel and kernel extensions the script is replacing are the ones used by the installer DVD itself to boot into its installation environment. The kernel extensions and kernel which is actually installed by the installer to your HD are unpatched - hence why we’ll need to do a little fiddling prior to our first boot after installation.
- You may see some binding error messages regarding frameworks, but this is normal.
- After patching, we’re left with a nice 4.7GB DVD image (Leo_Patched_DVD.iso - should be 4,698,669,056 bytes but if it’s a little out relax, it’s probably fine) which we can fit onto a regular DVD.
- Burn this image to DVD and grab another a coffee.
3. Installing Leopard
Pop your DVD into your regular PC and boot using it - either change your boot device priority to place a CD-ROM/DVD-ROM prior to any hard drives or (usually) hit F12 to get a boot menu in which you can select a device to boot using.
When you see the Darwin bootloader, it will ask you to either press any key to begin installation or to press F8 to enter startup options. You’re probably going to want to become familiar with verbose boot mode for troubleshooting later so why not start now. Hit F8 and type -v and press return. This will boot OS X in verbose mode so we can see what’s happening.
All going well, the installer should eventually land us at a language selection screen in a few minutes. Once in the installer we need to setup the hard drive we’re going to install OS X onto. For simplicity’s sake I’m going to assume you’ve got an entire disk to dedicate to installing OS X upon. Go into the disk utilty and select the disk you wish to install OS X onto. Go to the partition tab and using the drop down menu select “1 Partition” and use a Macintosh Journaled filesystem (HFS+). Give your partition a name (and take note of it, we’ll use this later). Now, there’s something which is really important to do here so please don’t skip this. You wouldn’t believe the amount of people who miss this step and then wonder why in the hell they can’t boot OS X after installation. Click Options and select Master Boot Record since regular PC’s use a BIOS instead of EFI and so can’t boot using a GUID disk. Click partition and then close the disk utility.
Within the installer wizard, on the screen with the “customize” button, click it and de-select everything you can (you won’t be able to de-select the base system of course). Failing to do this will cause the installer to fail since we removed a lot of stuff when we patched our DVD.
Install OS X and grab several coffees.
4. Leopard post patching
Leopard is now (hopefully) installed, but before we can actually boot into it we need to do some post patching (replacing the kernel and some kernel extensions). We also need to flag our partition as bootable and install the Darwin bootloader. There’s a few ways of doing this including booting into a prior OSx86 installation of Tiger but I’m going to assume that such an installation isn’t available to you. So to do all of this we’re going to copy the files we need to a portable USB hard drive or thumb drive, whichever is available to you.
- Extract the contents of the “patch” (3 folders, 2 files) folder within the zip you downloaded earlier into the root directory of your USB drive.
- Time for more shell script editing. Open postpatch.sh in a text editor of your choice.
-
PATCH="/Volumes/YOUR_USB_VOLUME_NAME/leopatch/" LEO="/Volumes/Leopard"
- Take note of the volume name for your USB drive and place it where YOUR_USB_VOLUME_NAME appears.
- Remember when you took note of the volume name you installed Leopard onto earlier? Change /Volumes/Leopard to reflect the name of the volume where you installed Leopard to.
- Boot into your Leopard installer once more. Plug your USB drive in at any time.
- While in the installer, open up a terminal.
- Run cd /Volumes/YOUR_USB_VOLUME_NAME
- Run ./postpatch.sh
- This should execute pretty quickly and may throw some errors regarding unfound kexts but that’s usually okay.
- Assuming all went well you should now have a good Leopard install, now all we need to do is make it bootable.
5. Making it bootable
This bit is/was annoying as hell and pretty much every guide out there was either completely wrong or was worded incorrectly, so this is my own explanation of how to do it.
- Open a terminal within the installer DVD once more
- Run diskutil list
- You’ll see a list of things like this:
-
/dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *69.2 Gi disk0 1: Apple_HFS Macintosh HD 69.2 Gi disk0s1
- Take note of /dev/disk0 - the 0 is our disk number. Also take note of the # of the partition corresponding to where we installed Leopard, in this case 1. With this in mind we know we can access our Leopard partition, in this case, through /dev/disk0s1 - disk 0, partition 1.
- Unmount your Leopard partition before you do anything else - either by going into disk utility and pressing the unmount button or by running “diskutil unmount /dev/diskXsx” replacing diskXsx with the disk and partition number where Leopard is installed.
- Run “fdisk -e /dev/rdiskX” where X is our disk number
- Run update
- Run flag 1
- Run w
- Run q
- Right, that should see our partition active. Now to install the darwin bootloader.
- Use cd to move into the makebootable folder in our USB drive, e.g. “cd /Volume/MyUSBDrive/makebootable”
- Lets put the bootloader, boot1h, at the start of our partition
- Run “dd if=boot1h of=/dev/rdiskXsx bs=512 count=1” with rdiskXsx being replaced with the disk and partition number where Leopard is installed.
- Enable the bootloader using startupfiletool
- Run “./startupfiletool -v /dev/rdiskXsx boot” again, replacing rdiskXsx with where Leopard is installed
- Now, lets bless the drive: “./bless24 -device /dev/diskXsx -setBoot –verbose”
- Almost there! Mount the drive: “diskutil mount /dev/diskXsx”
- Finally, bless the mount: “./bless24 -mount /Volumes/YOUR_VOLUME_NAME -setBoot -verbose”
Congratulations if you made it this far, we should now be good to go. Reboot your machine and it should (hopefully) boot into Leopard.
6. In closing
If everything works right away, fantastic! If not, there’s plenty of help at hand from the helpful folk at the OSx86 Scene Forums. Please please please don’t ask me to troubleshoot any problems you come across - there’s way too much that can go wrong with a regular OSx86 installation for me to know how to fix everything. Use the OSx86 forum’s search feature or chat to some of the people from there on IRC. If you spot something wrong in the guide, please let me know. I wrote in parts so I may have left something out or made a mistake or two here and there.
Hopefully after installing Leopard and having used it for a time you’ll do the right (and sane) thing and just buy a Mac. It’s easier and you won’t have to rely on a bunch of third party hackers to cobble together support. That said, it is an interesting thing to do and in doing so you will learn tons about Mac OS X’s innards - this alone was reason enough for me to give it a shot.
Tags: OSx86









November 4th, 2007 at 2:49 pm
Jason,
Great work! I’ve encountered the blinking cursor when booting into leopard after installation. Your article saved me. :)
But one thing you may have missed, you will need to unmount the leopard volume before updating the boot sector, you may want to add it in.
Great thanks!
November 4th, 2007 at 3:29 pm
@Rekeno
Whoops, almost forgot that, thanks! Glad it helped.
November 5th, 2007 at 9:54 pm
dear mister madigan this doesnt work what should i do it says “generic error”
November 7th, 2007 at 4:41 am
Great guide - although I was still presented with the blinking cursor thing… this worked for me though…
- Type: “dd if=/usr/standalone/i386/boot1h of=/dev/rdiskXsX bs=512 count=1″
(exchange “rdiskXsX” for your correct disk and partition number!)
- Type: “startupfiletool /dev/rdiskXsX /usr/standalone/i386/boot”
(exchange “rdiskXsX” for your correct disk and partition number!)
- Type: “bless -device /dev/diskXsX -setBoot -verbose”
(exchange “diskXsX” for your correct disk and partition number!)
- Type: “diskutil mount /dev/diskXsX”
(exchange “diskXsX” for your correct disk and partition number!)
- Type: “bless -mount /Volumes/Leopard -setBoot -verbose”
(exchange “Leopard” for the correct name of your Leopard partition!)
Bless24 didn’t work - gave me IODevice Tree errors - but Bless did - weird. And I have an MCP in Windows 200 and an A+ - drove me nuts for an entire evening!!
Anyways, your guide really got me through it - thanks!
-Gary
November 7th, 2007 at 10:17 am
Cheers for the comments Gary, I’ll do some testing on this at the weekend to see what’s up.
December 11th, 2007 at 8:14 pm
Hmm, I still get the blinking cursor. I will try Gary’s fix next.
December 11th, 2007 at 8:37 pm
:P
still a no go. I am using the patched ISO BrazilMac compiled. and using the patch files from this site. It seems like when I run the post patch that nothing is being altered. Hmmmm damn blinking cursor.
December 12th, 2007 at 10:18 am
@James,
You may wish to try installing PC_EFI - http://tinyurl.com/2ty4po
. Even if you did something like format OS X’s partition to GUID, PC_EFI will still be able to boot it.
December 12th, 2007 at 6:56 pm
Sweet, I will give it a shot. I did format the HD with the MBR not the GUID (i thought) but when I use the diskutilites I get UID errors when mounting the volume.
January 28th, 2008 at 9:58 pm
Great! It works!
Now the problem is how to connect my new ‘Mac’ to internet through my Linksys WRT54G (using a ethernet wire). It doesn’t detect this.
Thanks very much.
February 6th, 2008 at 3:36 pm
Hey man, trying to install the MacOS on my laptop that already has a partition with xp on it and I formatted my other partition to be a Mac OS Journaled; but nevertheless when I look at my hard drive I cannot change the options for the partition I have for the MacOS? Any ideas, if I install it without changing it to masterboot record I assume I cant access my MacOs right? Appreciate any help, cheers
February 14th, 2008 at 9:34 pm
Hi,
I’m trying to just install the Darwin bootloader into an empty HD… (I mean: I’m not following the whole guide)
But I was stuck in step 5 where it says:
// Run “dd if=boot1h of=/dev/rdiskXsx bs=512 count=1” with rdiskXsx being replaced with the disk and partition number where Leopard is installed. //
I’ve got the following error:
azul:/Volumes/azulChico/boot root# dd if=boot1h of=/dev/rdisk1s1 bs=512 count=1
dd: boot1h: No such file or directory
When I look in the man pages for dd I see that if is for the input file, and of is for the output file.
Can it bee wrong, and should say:
Run “dd of=boot1h if=/dev/rdiskXsx bs=512 count=1” with rdiskXsx being replaced with the disk and partition number where Leopard is installed.
Anyone?
(I’ll give a try anyway, but I’m not sure of this)
gracias
/j
February 14th, 2008 at 9:49 pm
hhhrrrmmmmmm….
Should have read before!
sorry, please ignore my post!!!
/thanks
/j
February 18th, 2008 at 10:03 am
This worked great on a Thinkpad X60s. Thanks.
March 2nd, 2008 at 4:48 am
This is great! I did the install on a stock eMachine T2984. Running fine so far.
April 17th, 2008 at 12:53 pm
hey this has been really helpful but I’m stuck at the part where I need to :
Use cd to move into the makebootable folder in our USB drive, e.g. “cd /Volume/MyUSBDrive/makebootable”
I constantly get No such file or directory no matter how I try to get to it. Can you please elaborate on the proper way to put this in. I’ve named the volume on my flash drive “myusbdrive” to try to make it simpler. Anyone who can help please respond
April 17th, 2008 at 1:23 pm
Also (and I believe this may be the cause of my problem) I can’t mount my flash drive so it doesn’t appear in the volumes folder if I us ls in the terminal. I have it formatted in Fat32, is there another format i should be using?
April 20th, 2008 at 3:36 pm
when i run the command in terminal i get this error with everything it tries to do pretty much “No such file or directory”
e.g.
cp: /Volumes/osx86dvd/Install Mac OS X.app/Contents/Resources/minibless: No such file or directory
help please i would really like to use leopard
April 22nd, 2008 at 7:26 am
anyone?
April 26th, 2008 at 4:29 pm
Kudos, Jason.
May 1st, 2008 at 8:53 pm
This is awesome, you resolved the one thing that I couldn’t seem to get my head around anywhere - making it bootable from the HDD!!!!!
You, sir, are a geniune Hero! Thanks
To think I hadn’t touched a Mac until I bought an old G4 back in Feb!
June 24th, 2008 at 1:40 am
Awesome tutorial i have tried several other iso’s none of which worked this one did however and i thank you from the bottom of my heart for this information i legally own mac os x leopard and i have a pc laptop which i am glad to report is now running leopard as well to bad apple charges 2,000 dollers for a laptop.