Monday, September 17, 2012

HP dv7t 6000 Windows 7 / Hackintosh 10.8.x Mountain Lion Dual Boot on One Drive

In order to compile Aphrodite on Mac, I spent a tremendous amount of time during the weekend (20+ hours!) to dual boot Mountain Lion and Windows on my dv7t 6000.  This was my first time installing Mac on a PC, and it was nothing like my prior experiences with dual-booting other operating systems together.  This time around, anything, and I literally mean anything, that could go wrong went wrong.  Torturous and extremely frustrating is the best I can describe this unpleasant experience.  So in order to give something back to the community, and hopefully save some poor soul the frustration and despair, I will briefly document the process here.

Please note that this is *not* an extensive step by step guide on how to have your hackintosh set up.  Unfortunately I am way too busy to be able to commit to doing a thorough write-up on this experience.  Still, this is a useful compilation of some pointers that should be more than enough to save you many headaches down the line.  Be prepared to spend some time researching to fill in between the gaps though.

1) Start by purchasing a copy of Mountain Lion on App Store. $19.99 at the time of this writing.

2) Skip this point if you are planning on installing Mac on a seperate HDD.  Read on otherwise.

Make sure that your hard disk drive is not partitioned dynamically.  Non-Windows operating systems have a hard time recognizing dynamic partitions, so you need to convert them back to basic if you intend to install Mac OS X on the same hard disk that you have your Windows on.  There are quite a few [both free and commercial] tools out there to help you convert dynamic disks to basic disks without loss of data.  Google for "convert dynamic disk to basic disk" to find them, and use one to convert your disk from dynamic to basic.  On top of that, rearrange your partition to end up with 3 primary partitions and 1 extended partition which can host as many logical partitions as there are drive letters left.  This is where you would want to have your non-OS partitions.  BE VERY CAREFUL when messing around with partitions though.  The smallest mistake can wipe all your data out and leave you with nothing but cold sweat, so backup the important stuff before the fact.

If everything goes well, you must have 3 primary partitions at this point.  The first one would be the SYSTEM partition which is automatically created when Windows is installed.  The second one would be your Windows partition, and finally the third one would be your newly created MAC partition.  Format the MAC partition with FAT32, or NTFS if it's larger than the FAT32 limit.

2) At this point, you are going to need a working Mac so you can set up a bootable USB drive with UniBeast installed on it.  You will use that to boot up your computer and install Mac.  Follow tonmacx86's UniBeast guide up to STEP 3.   At this point:

a) If you are installing Mac on a separate disk, skip this.  Read on otherwise.

Mac only supports GUID partition tables, so you will not be able to continue installation with your newly created MBR Mac partition.  Out of the box that is - don't panic! :)  Thanks to the community, there are patches that you can download to modify your USB installation disk with, so as to be able to install on MBR drives.  Can't remember the one I used, sorry, so Google for that.  Download it, and use it to modify the installation USB drive.

b) Regardless of your installation method, if you continue booting from UniBeast at this point, you will get a kernel panic on this setup.  While in the Chimera Boot Screen type the following command to instruct the kernel to use one core of your CPU to bypass the aforementioned KP.

cpus=1

Press enter and wait until you arrive at the installer.  If anything else went wrong, reboot, and re-trigger the installation processing with the -v option (on top of cpus=1) to turn on verbose outputs and report the error to the hackintosh community for help.  Rinse and repeat.

3) Considering that you managed to get to the installation itself, follow the rest of tonmacx86's UniBeast guide, up to STEP 4: Post-Installation.  Remember that if your installation page is scrambled like mine, you must use an external monitor connected to your laptop through the HDMI port to get a clear view.  I didn't investigate how to get the laptop monitor working flawlessly as I am primarily going to use this computer for development on an external monitor.  It would be nice if you would leave a comment if you found a solution though.

Again, until further notice, do not forget to enter the aforementioned cpus=1 flag each time you boot off of your installation USB or your newly installed Mac, or you will be welcomed with an annoying kernel panic.

4) The first time you boot into your newly installed Mac, pretty much all core devices work out of the box, except the wireless network adapter, and sound.  Your next step is to install a boot loader so as to be able to boot back into Mac!  The typical way of doing that is through MultiBeast - a one-step post installation tool.  Unfortunately though, that didn't work well for me as expected.  I wasted a huge amount of time getting my system working through MultiBeast and each time was let down by either unwelcomed kernel panics of all sorts or other small oddities and annoyances such as mouse and keyboard not working and whatnot.  I was this close to giving up...

When it suddenly occurred to me that if UniBeast is capable of booting my system with all of the core devices functioning properly, so should I, if I use the exact *.kexts provided by UniBeast!  Therefore, I only installed the boot loader and the Core i7 SDST fix through MultiBeast, and then went on to install the rest of the kexts manually by copying all the .kexts located under the /Extra folder in root of the UniBeast USB drive to a temporary directory in my home directory, changing their permission and ownership to system:

chmod -R 755 /*.kext
chown -R 0:0  /*.kext

and then copying the resulting *.kexts to /System/Library/Extensions:

sudo cp -R source_directory/*.kext /System/Library/Extensions

Rebooted, and almost everything was working again! [Should I remind you again, not to forget the cpus=1 flag?]

At this point, I used the lapic_fix Kernel Installer to make all my cores functional, and get rid of the annoying cpus=1 flag I had to enter upon each installation.  Next, I installed AICPMPatch kernel patch to get power management working again (also make sure to remove the null power management kext under /System/Library/Extensions since you are not going to need that with this patch applied anymore).

After 20+ hours of frustration and despair, I finally had a [somewhat] functional computer - enough to get me back on programming.

Hope this helps someone out there!

Tuesday, November 30, 2010