Introduction

In this posting I document the steps needed to create an installer disk image from Mac OS X 10.6 Snow Leopard retail DVD in a generic way. While the process is well documented by others[1], I’ll do it here once more with a twist. The whole thing is created in shell using only command-line tools. The resulting disk image can be written onto a USB storage media and then used to install the operating system to a generic PC that is supported by the retail version of Mac OS X. You’ll need a working Mac OS X 10.6 installation running on a genuine Mac or Hackintosh with root shell access. For sake of simplicity, we use an image of the Mac OS X 10.6 Snow Leopard DVD (called ~/Desktop/Hackintosh/Mac_OS_X_10.6_Snow_Leopard.dmg in this guide) so you must create it from your physical DVD beforehand[2].

Preparing the installer image

  1. Create a disk image file for the installation media. 6500 megabytes will hold the installation partition. The disk image will be initialized with MBR partition scheme and one partition is created onto it. Soon we’ll wipe out this partition, though.

    ~: $ hdiutil create -size 6500m -layout MBRSPUD -fs HFS+ \
            ~/Desktop/Hackintosh/Mac_OS_X_10.6_Snow_Leopard_Hackintosh_Install_Disk.dmg
    
    
  2. Attach the Mac OS X 10.6 Snow Leopard retail DVD image.

    ~: $ hdiutil attach -nomount -noverify ~/Desktop/Hackintosh/Mac_OS_X_10.6_Snow_Leopard.dmg
    
    
  3. The command will print the device name for the disk. Write that down. In the guide we’re using /dev/disk1.

  4. Attach the newly created empty disk image.

    ~: $ hdiutil attach -nomount -noverify \
            ~/Desktop/Hackintosh/Mac_OS_X_10.6_Snow_Leopard_Hackintosh_Install_Disk.dmg
    
    
  5. Write down also the device name for the installer disk. In the guide we’re using /dev/disk2.

  6. Now we use dd(1) command to clone the 3rd partition from the retail DVD that holds the Mac OS X installer and write it to the 1st partition of the installer disk. Be sure to adjust the device names according to your system as you can potentially destroy your installation big time if you screw up here. This might take quite a lot of time to complete.

    ~: $ dd bs=1m if=/dev/disk1s3 of=/dev/disk2s1
    
    
  7. Then mount the installer disk. The installer file system should be available at /Volumes/Mac OS X Install DVD.

    ~: $ diskutil mount /dev/disk2s1
    
    
  8. Fix the installer mountpoint so that file can be owned by root.

    ~: $ sudo diskutil enableOwnership /dev/disk2s1
    
    
  9. Rename the installer file system. After that the installer file system is available at /Volumes/Hackintosh Snow Leopard Install Disk.

    ~: $ diskutil rename /dev/disk2s1 "Hackintosh Snow Leopard Install Disk"
    
    
  10. Mark the file system so that fseventsd doesn’t keep any logs there.

    ~: $ sudo rm -rf /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/.fseventsd
    ~: $ sudo install -o root -g admin -m 700 -d /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/.fseventsd
    ~: $ sudo touch /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/.fseventsd/no_log
    ~: $ sudo chmod 400 /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/.fseventsd/no_log
    ~: $ sudo chown root:admin /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/.fseventsd/no_log
    
    

Install Chameleon boot loader

  1. The installer won’t boot on a generic PC without a special boot loader which loads the Mac OS X kernel in an environment that emulates real Mac. See more about Chameleon in the posting Create preboot image for Chameleon bootloader. Download Chameleon 2.0-RC4[3] boot loader and extract Chameleon-2.0-RC4-r684-bin.tar.gz somewhere, e.g. ~/Desktop/Hackintosh thus creating directory ~/Desktop/Hackintosh/Chameleon-2.0-RC4-r684-bin.

  2. First, unmount the installer disk so that we can write directly to the block device.

    ~: $ diskutil unmount /dev/disk2s1
    
    
  3. Next few steps are also documented in the file doc/README under Chameleon directory. We’ll install the initial boot code to the master boot record of the installer disk.

    ~: $ sudo dd if=~/Desktop/Hackintosh/Chameleon-2.0-RC4-r684-bin/i386/boot0 of=/dev/disk2 bs=440 count=1
    
    
  4. And then let’s install the 2nd stage boot code at the beginning of the 1st partition of the installer disk.

    ~: $ sudo dd if=~/Desktop/Hackintosh/Chameleon-2.0-RC4-r684-bin/i386/boot1h of=/dev/disk2s1
    
    
  5. Mount the installer disk again. The installer file system should be available at /Volumes/Hackintosh Snow Leopard Install Disk.

    ~: $ diskutil mount /dev/disk2s1
    
    
  6. Fix the installer mountpoint so that file can be owned by root.

    ~: $ sudo diskutil enableOwnership /dev/disk2s1
    
    
  7. And then copy the final stage of Chameleon boot code to the installer file system. We’re now done with the boot loader core installation.

    ~: $ sudo install -o root -g wheel -m 644 ~/Desktop/Hackintosh/Chameleon-2.0-RC4-r684-bin/i386/boot \
            /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk
    
    
  8. While not needed for Chameleon to operate, copy also the initial and 2nd stage boot code images to the installer file system. You may need these if you have to recover Chameleon installation.

    ~: $ sudo install -o root -g wheel -m 644 ~/Desktop/Hackintosh/Chameleon-2.0-RC4-r684-bin/i386/boot0 \
            /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk
    ~: $ sudo install -o root -g wheel -m 644 ~/Desktop/Hackintosh/Chameleon-2.0-RC4-r684-bin/i386/boot1h \
            /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk
    
    

Preboot image

Create preboot image for Chameleon that suits your system. I’ve written about this in the posting called Create preboot image for Chameleon bootloader. In the following steps it is expected that the preboot image is saved as the file ~/Desktop/Hackintosh/Preboot.dmg.

  1. Chameleon expects to find the preboot image under the directory Extra in the root of the installer file system. So let’s create that.

    ~: $ sudo install -o root -g wheel -m 755 -d /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/Extra
    
    
  2. Install the preboot image onto the installer file system

    ~: $ sudo install -o root -g wheel -m 644 ~/Desktop/Hackintosh/Preboot.dmg \
            /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/Extra
    
    

Boot configuration

Optionally, you can customize many boot properties such as boot console graphics mode or enabled hardware by creating the file Extra/com.apple.Boot.plist under the Chameleon boot disk. You could start by copying the file /Library/Preferences/SystemConfiguration/com.apple.Boot.plist from an existing Mac OS X Snow Leopard installation and then use it as template. Chameleon binary download[3] contains the file doc/BootHelp.txt which lists the supported com.apple.Boot.plist settings. Also these postings[4],[5] contain some useful info about com.apple.Boot.plist file.

If you want that the installer is booted automatically without displaying Chameleon GUI, use the following kind of boot configuration and save it as /Volumes/Hackintosh Snow Leopard Install Disk/Extra/com.apple.Boot.plist. Of course you may also add any local modifications, such as enabling of some hardware, if needed.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Kernel</key>
    <string>mach_kernel</string>
    <key>Kernel Flags</key>
    <string></string>
    <key>Legacy Logo</key>
    <string>Yes</string>
    <key>Quiet Boot</key>
    <string>Yes</string>
    <key>GUI</key>
    <string>No</string>
    <key>Scan Single Drive</key>
    <string>Yes</string>
</dict>
</plist>

Finalizing the installer

  1. Cleanup installer file system

    ~: $ sudo rm -rf /Volumes/Hackintosh\ Snow\ Leopard\ Install\ Disk/.Trashes
    
    
  2. Image is now ready! You can now eject the retail DVD and the installer disk images.

    ~: $ diskutil eject /dev/disk1
    ~: $ diskutil eject /dev/disk2
    
    

The installer image ~/Desktop/Hackintosh/Mac_OS_X_10.6_Snow_Leopard_Hackintosh_Install_Disk.dmg is now ready to be written onto a USB storage media.

References

When I used the “hdiutil attach -nomount -noverify ~/Desktop/Hackintosh/Mac_OS_X_10.6_Snow_Leopard.dmg” command it did not list any partitions. It only listed the /dev/disk1 so when I used the “dd bs=1m if=/dev/disk1s3 of=/dev/disk2s1 command” it did not work so I replaced disk1s3 with disk1 and it started running. I don’t know if this is a mistake or not and I do not know why the partitions were not listed but I will continue as if nothing is wrong. I was wondering If anyone knows shat I might be doing wrong.
Comment by Ben 2012-05-26T05:56:10 EEST
Hi
Hi, I’m trying to install Chem- boot after the installer I really didnt use the installer because I already have Mac install I just want to boot it it self. As I follow the step it tells me that there is no such a directory or files. thanks
Comment by Sheraz Siddiqui 2013-02-11T11:29:11 EET
Hi
Hi, I’m trying to install Chem- boot after the installer I really didnt use the installer because I already have Mac install I just want to boot it it self. As I follow the step it tells me that there is no such a directory or files. thanks
Comment by Sheraz Siddiqui 2013-02-11T11:34:16 EET
Hi
Hi, I’m trying to install Chem- boot after the installer I really didnt use the installer because I already have Mac install I just want to boot it it self. As I follow the step it tells me that there is no such a directory or files. thanks
Comment by Sheraz Siddiqui 2013-02-11T11:40:33 EET