Jump to content

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

Mavericks USB Linux installer 10.9

  • Please log in to reply
66 replies to this topic

#1
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

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.insanelym...ameleon-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.insanelym...ensor-for-1089/
sudo cp -r FakeSMC.kext/ /media/osx86/System/Library/Extensions/
NullCPUPowerManagement
Download and extract it
http://www.osx86.net...ment-32-64-bit/



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

http://www.insanelym...icks-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 :)

#2
palebluedot

palebluedot

    InsanelyMac Protégé

  • Members
  • Pip
  • 21 posts

Nice job! This will be very useful.



#3
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

Thanks. I hope somebody will try it and give some feedback.



#4
rainbowkisser

rainbowkisser

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts

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



#5
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

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.



#6
vlad2005

vlad2005

    InsanelyMac Protégé

  • Members
  • Pip
  • 38 posts
Great tutorial. It's possibil to do something similar with another version like 10.8, 10.7 or 10.6

#7
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

Thanks.

I think possible, the difference is only around the kernel. The kernel has different place on 10.6 and 10.7 not in the pkg.



#8
rainbowkisser

rainbowkisser

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts

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!



#9
rainbowkisser

rainbowkisser

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts
Nope didn't work :(

#10
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

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.



#11
renard_arg

renard_arg

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts

great job here ! works for me from a gentoo system ! 



#12
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

Cool, thanks.



#13
p4tr1k

p4tr1k

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts

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?



#14
rainbowkisser

rainbowkisser

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts
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 ##### 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

#15
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

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?



#16
jakedj93

jakedj93

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts

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



#17
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

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


#18
jakedj93

jakedj93

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts

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. :/



#19
tlac

tlac

    InsanelyMac Protégé

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Hungary

I got it. You downloaded the installable package but you should download the binary version, something like that: i386_vXXXX.zip



#20
jakedj93

jakedj93

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts

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?

Photo0318.jpg







Also tagged with one or more of these keywords: Mavericks, USB, Linux, installer, 10.9


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy