Sunday, January 10, 2016

How to fix Unibeast's "Selected Mac OS X Installer is Incomplete" error

Selected Mac OS X Installer is Incomplete

Your selected Mac OS X Installer is incomplete. Please delete all copies of the installer from all mounted volumes and redownload it again from the Mac App Store.

Do you receive above error message when you try to prepare a bootable USB  using Unibeast and a OS X installer downloaded from another machine, or a torrent? and you are 100% sure the downloaded installer is genuine copy?

Actually you can resolve this by doing either,
1. Simply changing the system time or
2. Patching Unibeast to remove a validation. 
(Changing 0000000100003262         je         0x1000032a2 to a NOP in Unibeast 6.1.1)

Both can be done easily. But I'm going to describe only the first option here. 

First let me explain few validations which are done by Unibeast before it allows you to create the bootable USB.

1. First validation it does is the Installer name and the path. Installer should be available at the /Applications directory with the correct name.

E.g.: 
/Applications/Install OS X Yosemite.app
/Applications/Install OS X El Capitan.app

2. Second validation is that,

If the installer is for Yosemite, then it checks for the string "com.apple.InstallAssistant.Yosemite" in the /Applications/Install OS X Yosemite.app/Contents/_MASReceipt/receipt file using "grep -q" command.

If the installer is for El Capitan, then it checks for "
com.apple.InstallAssistant.ElCapitan" in the /Applications/Install OS X El Capitan.app/Contents/_MASReceipt/receipt file using "grep -q" command.

3. The third validation is that it validates the signature of the receipt. This is the moment you get the "Installer is Incomplete" error message. This can happen either your receipt file is actually changed by someone or the certificates included in the receipt file are expired.

You can view the certificate information executing below command, (first change directory to /Applications/Install OS X xxx.app/Contents/_MASReceipt/ directory)

openssl pkcs7 -inform der -in receipt -print_certs -text

If your machine time is not within the validity period of the certificates, the signature validation is failed and Unibeast prompts the "Installer is Incomplete" error message.

e.g.:
openssl pkcs7 -inform der -in receipt -print_certs -text | egrep 'Not Before|Not After'
            Not Before: Nov 11 21:58:01 2010 GMT
            Not After : Nov 11 21:58:01 2015 GMT
            Not Before: Feb 14 18:56:35 2008 GMT
            Not After : Feb 14 18:56:35 2016 GMT
            Not Before: Apr 25 21:40:36 2006 GMT
            Not After : Feb  9 21:40:36 2035 GMT

In this case, the lowest "Not After time" is Nov 11 21:58:01 2015 GMT and the highest "Not Before time" is Nov 11 21:58:01 2010 GMT. Therefore the time of your machines should be within Nov 11 21:58:01 2010 GMT and Nov 11 21:58:01 2015 GMT.

Therefore if you change the machine time appropriately, let's say 2015/01/01 then Unibeast will proceed without prompting the  "Installer is Incomplete" error message. :)

Note: I think above validation was introduced by Unibeast developers to address a legal issue rather than making sure you have a genuine copy, because you can still have a modified installer files even when the receipt validation is passed.  So if you download the MAC OS X Installer from a torrent site or any other place, check the MD5 or SHA1 of the InstallESD.dmg file.

For Further reads about apple receipts,

Sunday, January 3, 2016

Building a hackintosh

First you need to read a lot about working builds before going in to building a hackintosh.
tonymacx86 is a very good resource on this subject and the community is very helpful.

I had only few options selecting motherboard and processes due to the availability in local computer market. Online purchasing was not an option due to the shipping cost.

Finally I decided to go with ASUS H97M-E and Intel i3-4330 haswell processor with integrated intel graphics (Intel HD 4600)
Make sure that the keyboard and mouse are USB and the monitor supports digital input (i.e. DVI-D or HDMI).

First you need to create a bootable USB with the target OS X. If you don't have a mac, you can prepare the USB using a VM. If you have a mac, then you can create the bootable USB easily.

Please note that this is not a step by step guide to build a hackintosh. However I have mentioned links which have the step by step guides useful in this process.

Download VMware Workstation

I was using Fedora 21, so I downloaded "VMware Workstation 12 Pro for Linux 64-bit".
Link: http://www.vmware.com/products/workstation/workstation-evaluation

Make sure that the version of the kernel and the version of the kernel-headers of your system are same. Otherwise the VMware installer will complain that it is unable to find the proper header files.

In my case they had different versions. So I updated the kernel.

[root@desktop9 ~]# rpm -q kernel-headers
kernel-headers-4.1.13-100.fc21.x86_64

[root@desktop9 ~]# uname -r
4.0.4-201.fc21.x86_64

[root@desktop9 ~]# yum update kernel

Unlock VMWare Workstation

You need to "unlock" VMware workstation to use your target OS X.

Download unlocker from here,
Link: http://www.daveparsons.net/downloads/unlocker207.zip

Run the unlocker script,
[root@desktop9 unlocker208]# ./lnx-install.sh 

Now it's the time to start the VMware workstation. Unfortunately VMware workstation threw errors and it was unable to start.

Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.

So I tried to load the required kernel module manually using modprobe.

[root@desktop9 ~]# modprobe vmmon
modprobe: ERROR: could not insert 'vmmon': Required key not available

After doing a google search I found out that the real reason for this error was the BIOS option "Secure Boot". I set the value for this bios option to "Other OS". After that the VMware workstation started.

Prepare ISO

Now you need an iso of the target OS X. I had Appstore copies of Mountain Lion and Yosemite operating systems. The original OS X comes as a dmg file. So you need to convert the dmg file to an iso.

I used dmg2img to convert Mountain Lion dmg file to an iso since the iso generated by the dmg2img for the Yosemite dmg didn't work with VMware workstation.

yum install dmg2img
dmg2img InstallESD.dmg InstallESD.iso

After that you will be able to use the iso on VMware workstation to create a new VM. Then you can use the VM to prepare a bootable USB with Yosemite or El Capitan using Unibeast.

Step by step instructions for preparing a Mac OS X VM on VMware workstation are available in this blog,
Link: https://mizitechinfo.wordpress.com/2014/07/13/installing-mac-osx-10-8-on-vmware-workstation/

Prepare the bootable USB using Unibeast

Unibeast seems very sensitive when it comes to finding the OS X from /Applications directory with correct names and files. It does not support to load an OS X installer from a user provided location.

If you already have a downloaded OS X installer, you need to copy that to the /Applications directory. However sometimes it complains that it couldn't locate the installer or the "installer is incomplete" if you copy the installer manually to /Applications directory.

If OS selection is greyed out in Unibeast, make sure that the OS X installer has the correct name and copied to the correct location.
e.g.: "Install OS X Yosemite.app" in /Applications directory.

Sometimes it still does not work even though the OS X installer is placed correctly. Try setting the system time to a previous year, e.g.: 2010 and rerunning the Unibeast in such a scenario.

Update: Please read this blog post if you are unable to make the OS X Installer recognized by Unibeast.
http://swapoff.blogspot.com/2016/01/how-to-resolve-unibeasts-selected-mac.html

Install the OS X

Once you have prepared the bootable USB, you should be able to use it to install the OS X on your build.

Step by step instructions on preparing the USB and installing it on your build using Unibeast and Multibeast are available in tonymacx86 site.