Jump to content
tlac

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

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 :)

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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. :/

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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?

Photo0318.jpg

Share this post


Link to post
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.

 

Share this post


Link to post
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...

Share this post


Link to post
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.)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Vyzantion
      I would like to try to install Catalina on a 64 GB flash drive, in order to bypass the SATA issue. I so thay many managed to do that on external SSDs.
      Actualy, already tried it. The first step finished ok, just it took much longer. After first booting from the target flash drive from the installing flash drive, it blocked on something like ”installer will create a non-removeable partition”. Perhaps if I waiting long enough, I would have passed that phase, but there were already some 15 minutes since it blocked.
    • By fusion71au
      This is a brief guide on how to create a vanilla El Capitan (also same process for Sierra) OS X Installer USB with an updated prelinked kernel containing FakeSMC.

      It is tailored for those users who want to understand the “nuts and bolts” of how to create an installer and also to help brush up on their terminal skills (rather than have one made for them with the numerous automated “tools” available or even Apple’s createinstallmedia) :
       
       
      Specifically, it is also a “Proof of Concept” which shows that installation is possible without even having to rely on boot loader kext injection.

      Prerequisites
      Existing Yosemite installation (or Mavericks - see post#4 for steps 7,8) “Install OS X El Capitan.app" downloaded to the Applications folder Pacifist FakeSMC.kext - Slice or Kozlek branch Bootloader - Clover or Chameleon 8GB or larger USB drive (16GB recommended), formatted HFS+ (MBR or GUID) named “Installer”  
      Procedure
      1.  Boot into Yosemite with the kext-dev-mode=1 boot flag
      2.  Open OS X terminal and type the following lines, followed by <Enter> after each line.
          The image restore and file copying may take a while to complete, and at the end of the process, the Installer volume is renamed to “OS X Base System"....
       
      sudo -s hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg asr restore -source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg  -target /Volumes/Installer -erase -format HFS+ -noprompt -noverify rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages cp -av /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation cp -av /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System diskutil unmount /Volumes/OS\ X\ Install\ ESD exit 3.  Right click on the “OS X Base System” Volume and click “Get Info”
       

      4.  Click on the lock icon and untick “Ignore ownership on this volume”
       

      5.  Extract/Copy the El Capitan Kernels folder into /System/Library/ of the USB with Pacifist.  NB It is found in the "Essentials.pkg" in /System/Installation/Packages
       

      6.  Delete or Rename the original /System/Library/PrelinkedKernels/prelinkedkernel —> OG.prelinkedkernel
       

      7.  Copy FakeSMC.kext and other necessary kexts (e.g. VoodooPS2Controller.kext for laptops) into the /Library/Extensions folder of the installer USB using Finder.
       

      8.  Back in terminal, type the following lines, followed by <Enter> after each line to rebuild the prelinkedkernel…..
       
      sudo -s chmod -R 755 /Volumes/OS\ X\ Base\ System/Library/Extensions chown -R 0:0 /Volumes/OS\ X\ Base\ System/Library/Extensions touch /Volumes/OS\ X\ Base\ System/System/Library/Extensions kextcache -u /Volumes/OS\ X\ Base\ System exit Any errors should be noted but the output below is normal e.g.


      9. Install your Bootloader targeting the OS X Base System volume
       
       
       
       
      10.  Boot your system with the USB without injected kexts into the OS X Installer GUI....
       
       
       
       
       
      Post Install
      The original prelinked kernel in a fresh install of El Capitan will also lack FakeSMC ie it will only be linked to Apple signed kexts.  In order to boot into El Capitan the first time around without boot loader kext injection, the PLK needs to be rebuilt for the El Capitan volume like we did for the installer:
       
      1.  Boot into Yosemite with the kext-dev-mode=1 boot flag
      2.  Delete or Rename the original /System/Library/PrelinkedKernels/prelinkedkernel for the El Capitan volume —> OG.prelinkedkernel
      3.  Copy FakeSMC.kext and other necessary kexts (e.g. VoodooPS2Controller.kext for laptops) into the /Library/Extensions folder of El Capitan using Finder
      4.  Back in terminal, type the following lines, followed by <Enter> after each line to rebuild the prelinkedkernel.  In this example, the El Capitan volume is named "El_Capitan" - change if you have named it something else...
      sudo -s chmod -R 755 /Volumes/El_Capitan/Library/Extensions chown -R 0:0 /Volumes/El_Capitan/Library/Extensions touch /Volumes/El_Capitan/System/Library/Extensions kextcache -u /Volumes/El_Capitan exit 5. Install your Bootloader targeting the El Capitan volume.  This step is only necessary if you are installing El Capitan on a new drive without existing boot loader (not required if installing on a disk with existing boot loader beside Yosemite).
      6. Reboot your system without injected kexts into El Capitan!
       
       
      Other links
      The All-In-One Guide to Vanilla OS X for beginners
       
      Updates for Sierra and High Sierra   Custom Prelinkedkernel Generator Tool I have made a custom prelinkedkernel generator "PLK.tool" for Sierra + El Capitan.  Instructions:   1.  Download and extract the attached BaseSystem_PLK.tool.zip into your ~/Downloads folder.   2.  Copy any extra kexts necessary for booting your hack to ~/Downloads/BaseSystem/ExtraKexts (e.g. FakeSMC, VoodooPS2Controller), making sure SIP is disabled. 3.  Copy BaseSystem.dmg to ~/Downloads/BaseSystem  4.  Open terminal and run the following commands... cd ~/Downloads/BaseSystem chmod +x PLK.tool ./PLK.tool ---> supply your admin password ---> will place your new custom prelinkedkernel on the desktop.       macOS High Sierra bypass Firmware and MBR checks in post#13.
      BaseSystem_PLK.tool_ElCap.zip
      BaseSystem_PLK.tool_Sierra.zip
      BaseSystem_PLK.tool_Mojave.zip (need to run in Mojave to avoid dependency errors)
      BaseSystem_PLK.tool_Catalina.zip
    • By Gabigeek
      Hi everybody,
      First this is my first post on this forum so I hope Im creating a topic at the right place 
      Im french, so sorry for my bad english 
       
      So I recently made a Hackintosh Laptop (on a ROG GL553VD-DM078T )
      This laptop is based on a i7 7700HQ and a GTX1050.
      I installed MacOS Sierra using the Clover bootloader and succesfully installed  the kexts needed but one of them is causing trouble.
       
      I Broke my internal ethernet Port so I must use a USB-C ethernet dongle in order to acces the internet ( The Integrated Wifi chipset isn't compatible so that's my only way to connect.)
      Without the UsbInjectAll.kext everything works exept my laptop keyboard wich use USB (yes, the internal ASUS Aura keyboard use USB interface, not PS2 or IC2 ).
      But if I load the UsbInjectAll kext the keyboard works, but the USB-C ethernet dongle is no more recognized at all ( not even in the system report menu)
      The weird thing is that if I plug a USB stick in the USB-C port, it works, but the ethernet dongle won't.
       
      So now I have 2 options :
      -or I load the UsbInjectAll kext and I get my keyboard to work
      -or I disable the UsbInjectAll kext so i can get back my ethernet USB-C dongle to work, but no more keyboard....
       
      Can someone explain why do this happen ? Is there a way to get both The Ethernet dongle and my internal keyboard to work at the same time ?
      If Needed, I can provide more information about the hardware Used etc.
       
      Have a good Day/night 
    • By jdorz
      Hello all,

      I have successfully gotten my Hackintosh working 99 percent. The remaining issue that I am running into is that my system will randomly kernel panic upon a user issued shutdown or reboot WHEN I have either a usb sound card or usb headset plugged into any of my USB ports (both 2.0 and 3.0). If I remove the headset, it will power down with no issues. Does anyone have any suggestions?

      My system is as follows:
      MacOS 10.14 Mojave
      Gigabyte H370 HD3
      8400 i5 Coffee Lake
      Radeon RX 580 sound card

      I have the internal audio disabled. I have also attached my config.plist file.

      I have the following Kexts installed:

      FakePCIID_XHCIMux.kext
      USBInjectAll.kext
      FakeSMC.kext
      WhateverGreen.kext
      IntelMausiEthernet.kext
      XHCI-300-series-injector.kext

      Lilu.kext


      Thank you.
      config.plist
×