Jump to content

[Guide] How to make a bootable OS X 10.9 Mavericks USB install drive on LINUX


tlac
 Share

83 posts in this topic

Recommended Posts

How to make a bootable OS X 10.9 Mavericks USB install drive on LINUX

This guide describes step by step how you can make a Mavericks USB installer on Linux without any running OS X.

Prerequisites

-empty USB stick of minimum size 8GB
-copy of Mavericks
-working Linux (virtualized is also OK) with following installed packages:
hfsplus, hfsprogs, gparted, p7zip
-at least 15GB free space on your system
-time :)

Steps

1. Check the downloaded installer

You should have something similar location with the main DMG file

"YOUR_PATH/Install OS X Mavericks.app/Contents/SharedSupport"

Open a terminal window, go to this directory and check the MD5



cd YOUR_PATH/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/
md5sum InstallESD.dmg
10.9 (13A603) f222952400db8535c03697c3293e168e
10.9.1 (13B42) f67bf055be1a494eb2547e17e74a0c13
10.9.2 (13C64) fdb286dd1a321eb9ae1bd136d5d388c3
10.9.3 (13D65) 0c45a5fec46d157e8f892c11b840daf2
10.9.4 (13E28) 9d9aeba42a9fb2cf6d2f2e8c18827f83
10.9.5 (13F34) a418ad26903961b060d7df02884a6511

2. Prepare the USB stick

Create a new MBR partition layout on your USB stick and add a primary HFS+ filesystem.

I prefer using gparted. Steps in this program:
-choose your USB stick at upper right corner
-go to menu: Device / Create partition table and select msdos
-go to menu: Partition / New and create a primary parition with HFS+ filesystem. The label can be osx86.
-go to menu Edit and apply all your pending changes

If the above is done, mount the newly created partition to /media/osx86/

3. Copy OS X's files

The InstallESD.dmg contains another InstallESD.dmg file. We need that.
cd YOUR_PATH/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/
7z x InstallESD.dmg InstallMacOSX.pkg/InstallESD.dmg
We got the a new InstallESD.dmg file. This file contains an HFS partition, we are extracting it.
cd InstallMacOSX.pkg/
7z x InstallESD.dmg 3.hfs
Now we can delete the unnecessary DMG file.
rm InstallESD.dmg
Mount the HFS file, do this with root rights (sudo or su - depending on your distribution)
sudo mkdir /mnt/osx
sudo mount -o loop 3.hfs /mnt/osx/
Extract the HFS partition from the BaseSystem.dmg
mkdir base
cd base
(We are here: YOUR_PATH/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallMacOSX.pkg/base)
7z x /mnt/osx/BaseSystem.dmg 3.hfs
Mount the new HFS file as well, do this with root rights
sudo mkdir /mnt/base
sudo mount -o loop 3.hfs /mnt/base/
Copy the files to the USB stick, do this with root rights

I suppose your USB drive is mounted here: /media/osx86/
sudo cp -r /mnt/base/. /media/osx86
sudo rm /media/osx86/System/Installation/Packages
sudo cp -r /mnt/osx/Packages /media/osx86/System/Installation
Clean, do this with root rights
sudo umount /mnt/base
sudo rmdir /mnt/base
sudo umount /mnt/osx
sudo rmdir /mnt/osx
Delete other unnecessary files

We are still here: YOUR_PATH/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallMacOSX.pkg/base
cd ../../
rm -r InstallMacOSX.pkg
Kernel is in the Packages/BaseSystemBinaries.pkg. We are extracting it.
mkdir kernel
cd kernel
7z x -so /media/osx86/System/Installation/Packages/BaseSystemBinaries.pkg Payload | bunzip2 | cpio -i
Copy kernel to the right place, do this with root rights
sudo cp mach_kernel /media/osx86/
Delete the garbage
cd ..
rm -r -f kernel/
 
4. Install the Chameleon bootloader

Download the binary version of it and extract it
http://www.insanelymac.com/forum/files/file/59-chameleon-22-svn/

Find the dev file depending on your mount point:
mount | grep osx86
For example I got this:
/dev/sdb1 on /media/osx86 type hfsplus (rw,nosuid,nodev,relatime,umask=22,uid=0,gid=0,nls=utf8,uhelper=udisks)

So the dev file will be /dev/sdb for the writing of MBR:
sudo dd bs=446 count=1 if=boot0 of=/dev/sdb
and /dev/sdb1 for the writing the begining of the HFS+ partition:
sudo dd if=boot1h of=/dev/sdb1
Copy the boot file to the root of your USB stick
sudo cp boot /media/osx86
 
5. Install essential kexts

FakeSMC
Download and extract it
http://www.insanelymac.com/forum/files/file/107-fakesmc-w-haswell-cpu-sensor-for-1089/
sudo cp -r FakeSMC.kext/ /media/osx86/System/Library/Extensions/
NullCPUPowerManagement
Download and extract it
http://www.osx86.net/files/file/3465-nullcpupowermanagement-32-64-bit/



sudo cp -r NullCPUPowerManagement.kext/ /media/osx86/System/Library/Extensions/
6. Optional - Install MBR patch

http://www.insanelymac.com/forum/files/file/145-mavericks-mbr-patch/



sudo tar zxvf Mavericks_GM_MBR_Patch.tar.gz -C /media/osx86/
7. Troubleshooting
 
If you get this weird error message: "There was a problem reading the Mac OS X Installation disc. Carefully clean the disc, and then try reinstalling.", use the below command



sudo chmod 6755 /media/osx86/System/Library/PrivateFrameworks/Install.framework/Versions/A/Resources/runner
8. Finally DONE :)
  • Like 17
Link to comment
Share on other sites

Sorry I had to fill out those two silly quizes. I tried it and the installation loads up perfectly no KP but when I press English for language then it comes up with the "The installation cannot read the mac os installation disk try cleaning the disk and trying again. I mightve messed it up but I will try it tomorrow again and then Ill let you guys know :D. Will also try it with a different flash drive to be certain.

 

I did it on a ASUS S400CA Ultrabook with Core i5 3317U Processor, 4Gb DDR3 1600Mhz, 24gb Sandisk, 500Gb Seagate I think. Flashdrive was an ADATA

Link to comment
Share on other sites

Actually this is a great news. You followed perfectly my guide.
I also experienced this problem when I installed the MBR patch. I notified the uploader of this patch about the problem and he fixed it some days ago.
When did you download the MBR patch? I suggest download it again and reapply the step 7. Maybe it will solve your problem.

Link to comment
Share on other sites

Ok so I am going to give this a go right now and I'll let you guys know how it goes :D

 

Edit: I think I may have found the problem but I am not sure. The copy of OS X Mavericks that I downloaded is build 13A593 and Nobody seems to have a MBR patch :( I really dont want to download another copy of Mavericks since I'm from South Africa and my internet is really slow here. Ideas?

 

Reedit: That build doesnt exist but it says thats my build in my info.plist files :/ strange!

Link to comment
Share on other sites

Edit: I think I may have found the problem but I am not sure. The copy of OS X Mavericks that I downloaded is build 13A593 and Nobody seems to have a MBR patch :( I really dont want to download another copy of Mavericks since I'm from South Africa and my internet is really slow here. Ideas?

You should get the latest version. You won't have updates and support for the developer version.

But if you really don't care about them, maybe you can try to install without the MBR patch on GUID partitioned system.

Link to comment
Share on other sites

Thanks for a very detailed and clear guide.

I seem to experience the same problem as rainbowkisser (the clean disk message).

My Info.plist file says my build is 13A602 however I get the correct md5sum.

I have tried to install both with and without the MBR patch.

Do you know any other possible sources to this problem?

Link to comment
Share on other sites

I couldn't solve it but I found a friend with a Mac and then mounted the app.dmg that I had copied the app to applications and used [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url] to created a bootable flash. All worked out fine in the end but I did have to boot with IGPlatformID=01660003 IGPEnabler=Yes GraphicsEnabler=No and that made it all work perfectly :) if you can't find anyone who has a mac try downloading a copy of OS X which is virtualizable then use either virtual box or VMware. Seems like it's a bit of a mission though.

You knee beest ;) that's the #'s

Link to comment
Share on other sites

Thanks for a very detailed and clear guide.

I seem to experience the same problem as rainbowkisser (the clean disk message).

My Info.plist file says my build is 13A602 however I get the correct md5sum.

I have tried to install both with and without the MBR patch.

Do you know any other possible sources to this problem?

That's odd.

Can you try to do again the whole process without the MBR patch and check the logs in the installer when you get the error?

Link to comment
Share on other sites

  • 1 month later...

All went smoothly until the boot loader, this is what my terminal looks like, can someone please explain to me what I am doing wrong?

 

jake@jake-LX ~ $ mount | grep OS\ X\ Mavericks
/dev/sdc1 on /media/jake/OS X Mavericks type hfsplus (rw,nosuid,nodev,uhelper=udisks2)
jake@jake-LX ~ $ sudo dd bs=446 count=1 if=boot0 of=/dev/sdc
[sudo] password for jake:
dd: opening `boot0': No such file or directory

Link to comment
Share on other sites

All went smoothly until the boot loader, this is what my terminal looks like, can someone please explain to me what I am doing wrong?

 

jake@jake-LX ~ $ mount | grep OS\ X\ Mavericks

/dev/sdc1 on /media/jake/OS X Mavericks type hfsplus (rw,nosuid,nodev,uhelper=udisks2)

jake@jake-LX ~ $ sudo dd bs=446 count=1 if=boot0 of=/dev/sdc

[sudo] password for jake:

dd: opening `boot0': No such file or directory

It does not find the boot0 file. Run this command where you extracted the bootloader or you can specify it like:

sudo dd bs=446 count=1 if=/path/for/the/file/boot0 of=/dev/sdc
  • Like 1
Link to comment
Share on other sites

Thanks a ton dude, I have learned a lot and can make my way around a terminal, but I am still learning of course! But I still get the "not a directory" problem, the file for the boot I have is called Chameleon-2.2svn-r2269.pkg, not sure where I find this "boot0" still. :/

Link to comment
Share on other sites

I totally missed a step actually, my bad. I gotta go but ill start over later and report back!

 

EDIT: I got the drive bootable but now I get some kind of error, any idea what this means?

 

 

It looks you did not install the NullCPUPowerManagement.

 

If the MBR patch didn't work, what should i do? repeat all the steps without the patch part, or can i just undo the patch?

 

How do you mean by it didn't work? What's the exact problem?

Theoretically you shouldn't repeat all steps.

 

Link to comment
Share on other sites

 

How do you mean by it didn't work? What's the exact problem?

Theoretically you shouldn't repeat all steps.

I have the same problem as rainbowkisser... it shows "The installation cannot read the mac os installation disk try cleaning the disk and trying again".... i follow all the step including the optional add patch to MBR...

 

so... if i want to undo the MBR patch, what step should i do? what files i should delete to undo the patch...

Link to comment
Share on other sites

I thought this problem is already resolved.

Can you show me the permissions of these files?

ls -l /media/osx86/System/Library/PrivateFrameworks/Install.framework/Frameworks/OSInstall.framework/Versions/A/OSInstall
ls -l /media/osx86/System/Installation/Packages/OSInstall.mpkg

I'd like to fix it finally.

 

Anyway the MBR patch overwrite the above files

(And maybe overwrite some permissions of directories, it could be the root of the problem.)

Link to comment
Share on other sites

I thought this problem is already resolved.

Can you show me the permissions of these files?

 

ls -l /media/osx86/System/Library/PrivateFrameworks/Install.framework/Frameworks/OSInstall.framework/Versions/A/OSInstall
ls -l /media/osx86/System/Installation/Packages/OSInstall.mpkg
I'd like to fix it finally.

 

Anyway the MBR patch overwrite the above files

(And maybe overwrite some permissions of directories, it could be the root of the problem.)

the error is probably because i downloaded the MBR patch from osx86.net (13A598) which is older than the one on insanelymac.com(13A603) ... that's why i got the error messages.

I will try redownload the MBR patch and try it again... right now there's no intel based computer near me to tried them on...

 

---update---

after i patched my usb-stick using patch from insanelymac.com i still got the error...

this is the line if i put the ls command you asked:

-rwxr-xr-x 1 root root 562576 Oct  4 16:40 /media/untitled/System/Library/PrivateFrameworks/Install.framework/Frameworks/OSInstall.framework/Versions/A/OSInstall
-rw-r--r-- 1 root root 859532 Oct 21 10:04 /media/untitled/System/Installation/Packages/OSInstall.mpkg
Just to clarify... currently i didn't want to install maverick just yet because i don't have an empty hard drive. I just want to make sure that my installation usb-stick works. So when i tried the installer, i didn't attach any hard drive to the machine. Could this be the reason why i'm getting error messages?

an additional info: during the boot session there's a line that said: BootCacheControl: Unable to open /var/db/bootcache.playlist:2 No such file or directory... but after that the boot process continue and keep running until the gui start.

Link to comment
Share on other sites

  • Allan unpinned this topic
 Share

×
×
  • Create New...