Two Birds With One Stone
So I have this old secondhand MacBook Pro 7, 1 that won’t run MacOS later than 10.13.x. I have some uses for the Mac side, namely in the name of mobility, but would also love to get an install of Kali Linux installed so I can play around with it. I saw a comment on Reddit referencing a tool named “Patcher” that would allow for newer versions of MacOS on older Mac hardware. I immediately went down the rabbit hole and here we are.
Outlined below are the steps I took to get Catalina installed, a custom boot manager installed, and Kali Linux running in a dual boot setup. There are 3 main segments to this:
- Create a bootable Catalina USB installer using Patcher then installing Catalina on my unsupported machine.
- Install a custom boot loader onto my machine.
- Copy a Kali Linux iso to a USB drive, then install it onto my machine.
Patcher – Run Newer MacOS on Unsupported Hardware
Prerequisites – Here’s all you need to get started with Patcher:
- Patcher for Catalina: http://dosdude1.com/catalina/
- An unsupported Mac with a hard drive we can wipe.
- A USB thumb drive larger than 10Gb
Getting this going is super easy as the Patcher app does just about everything for you. USB installer creation can be performed on any machine. Once Patcher was downloaded I performed the following steps:
- Open the Patcher DMG and run macOS Catalina Patcher.app.
- Click Continue until you are prompted to either browse for a copy of Apple’s Catalina installer or download a fresh copy. It is imported to note that at the time of this writing 10.15.4 has been released but Patcher and 10.15.4 isn’t working on most machines. Therefore you should use Patcher’s “Download a Copy” feature to grab a copy of 10.15.3, which works.
- Insert your USB.
- Once Catalina is downloaded click the orange external drive icon to “Create a Bootable Installer”.
- Select your USB drive, then click start.
- Enter your password when prompted to begin.
- Once done your USB drive is ready to rock.
- Plug the USB into your unsupported Mac, hold option to bring up the boot picker, and select the Patcher USB.
- Once booted you’ll be presented with a list of options. Highlight Disk Utility and then click continue.
- We need to leave some space for Kali. Above the left pane click View–>Show All Devices.
- Highlight the internal HDD and then click the partition button.
- Create 2 partitions, an APFS partition for our Catalina install and another for Kali. It is up to you to decide how large you wish these to be. I set the Kali partition to be HFS nut this shouldn’t matter since it will be reformatted when we install Kali.
- Close Disk Utility, highlight reinstall macOS, click Continue, agree to terms, select your newly created APFS volume, then click install.
- Once done reboot back into the Patcher USB.
- Click macOS Post Install
- Leave checkboxes alone and click to install patches.
- Allow system to reboot, then boot back into the Patcher USB.
- While were at it, let’s disable SIP. We’ll need to do this in order to install Kali. Click Utilities on the upper toolbar then disable SIP with the following command:
- Reboot and setup Catalina for your use.
Installing rEFInd – Custom Bootloader
Prerequisites – Here’s all you need to get rEFInd onto your machine:
- Your Mac
- The latest version of rEFInd: https://sourceforge.net/projects/refind/
Despite involving some terminal commands this is really quite simple. We’ll mount the EFI volume on the Mac then throw the rEFInd files onto it. It involves a few terminal command but again, quite simple.
- Verify your architecture with the following command:
ioreg -l -p IODeviceTree | grep firmware-abi
- You should get something similar to the following:
| | "firmware-abi" = <"EFI64">This indicates 64bit.
- Run the following command to verify where the EFI partition lives:
- Take note of the identifier as indicated in the below screenshot:
- Run the following commands to create a directory with which we can mount the EFI volume to, mount it, and create a directory for rEFInd. EFI should be at disk0s1 but if it is different for you then modify the command below appropriately.
sudo mkdir /Volumes/ESP
sudo mount -t msdos /dev/disk0s1 /Volumes/ESP
sudo mkdir -p /Volumes/ESP/efi/refind
- Download rEFInd and unzip it.
- Copy the contents of the refind subdirectory to the refind directory we created in the above command.
- More than likely you are running 64bit EFI. Delete the following to avoid conflicts:
- Delete the following drivers, also to avoid both conflicts and slow boot times:
- Rename refind.conf-sample to refind.conf.
- Now we must bless all things holy in order to boot to our new loader:
sudo bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/EFI/refind/refind_x64.efi --shortform
- Reboot the machine and you should be presented with the rEFInd bootloader, which should look like this:
Kali Linux – Installation Time
Now that we have our machine prepped we can create a Kali USB installer, boot to it, and install Kali onto our Mac. This part is pretty simple too but you need to be careful when formatting an installation partition, lest you nuke your macOS install. Here’s what you need:
- Your Mac
- Kali iso: https://www.kali.org/downloads/
- A USB thumb drive large enough to house the Kali iso
- Etcher : https://www.balena.io/etcher/
Here’s what I did:
- Open Etcher.
- Select the iso you downloaded, select your USB drive, click “Flash”.
- Plug your Kali USB into your destination Mac and boot it.
- Your USB should show up as:
Boot Legacy OS from whole disk volume
- Once booted select “Graphical Install” and proceed with setting up machine name, username, etc.
- When prompted to manage disks/partitions choose “Manual”.
- Select the HFS volume you created earlier and delete the partition.
- This will now show up as free space.
- Go back to Guided Partitioning and select “use the largest continuous free space”.
- Select your desired partitioning schema. I just used the whole partition for all files, nothing fancy.
- Elect to write the changes to disk.
- Kali will now install, I am not sure if Grub is required but I installed it on my HDD when prompted.
I imagine you could do this with any Linux flavor, not just Kali. I haven’t attempted to play around with Debian or CentOS or anything but I see no reason why it wouldn’t work for any other Linux distributions.
I’m just a normal sysadmin type guy who likes cybersecurity a lot.