With the question of hardware sorted out and all the parts ordered and installed, I was ready to proceed to the installation. This post will describe the steps to do the installation. This post is the 3rd in a series about this new Hacintosh build.
The full hardware info is in my first post about this new build but for the basics, the target computer is a Dell Optiplex 9020 MT with an i7-4770 processor. The MT and the SFF versions of the 9020 are pretty similar so this should work on either and I imagine most of the processor versions are about the same too. But perhaps an i3 might not work and the USFF version has different ports that wouldn’t work with the files here.
This is my first build with OpenCore and I think in the end, the result is a better running computer – at least so far that seems to be the case. The path to getting this installation working wasn’t entirely smooth but it wasn’t too bad. I wrote about the process of getting to this point in the second post in this series. And that post has all of the references and sources for my build procedure. This post is just the Guide to getting the install done.
This guide describes a dual boot setup with both MacOS Monterey and Windows 10 but if you wanted to, you could skip the Windows 10 part entirely.
As always, many thanks to the Hacintosh community – @morpheousman and @Baio77, in particular, for sharing their setups to get me going.
As usual, if anything written here causes computer failure or data loss or anything else happens to you as a consequence of what I have written, whether legal, physical, or emotional, it’s all on you. And if things like creating partitions, typing in terminal, or making changes in the BIOS are tasks with which you are unfamiliar or uncomfortable, now is a good time to click the “Back” button in your browser and go somewhere else. But thanks for visiting.
Overview And Jump to Sections
- A. Install Windows 10
- B. Prepare Staging Computer
- C. Add SMBIOS content to config.plist
- D. Create the MacOS Installer UFD
- E. Prepare Target Computer
- F. Install MacOS
- G. OpenCore on Target computer
A. Install Windows 10
The first thing to do is install Windows 10 on the smaller drive. As noted in the post about hardware, I have a main drive and a smaller secondary drive. They could both be on the same physical drive if need be but the simplicity of having them separate is worth deploying with a second drive. I’m not going to run through the install for Windows 10 other than to note that you should keep it as basic as possible. For step-by-step instructions for installing Windows, see that part of a prior Hacintosh post. Note that you could probably do this Windows install any number of places in this process but this time it seemed easiest to get it out of the way early on. Also, if you are going to need to do a BIOS upgrade, it’s easier to do with Windows installed. But you could skip this step entirely.
Oh, and there are BIOS settings in section E that could change how Windows installs so actually, you can go read through that section now and be sure you have the things set correctly for SATA control, AHCI, etc..
B. Prepare Staging Computer
You are going to want to start this process on an existing Macintosh or an existing Hacintosh. This will be the “staging computer” – the computer you use to set up your tools before moving to the target computer.
- Start by making sure you have Python installed. If you get a response, you are all set. If you don’t have python installed on the staging computer, download and install it.
python3 --version
- Next, install Xcode (click install, click agree) and follow that with an install of pip3.
xcode-select --install
pip3 install xattr
- Now get the a script to download the MacOS installer from apple. The following single command creates the directory, changes to it, and gets the script.
mkdir -p ~/macOS-installer && cd ~/macOS-installer && curl https://raw.githubusercontent.com/munki/macadmin-scripts/main/installinstallmacos.py > installinstallmacos.py
- Now run the script that was downloaded and choose the number that is the most recent version of the most recent OS (look for the name of the OS in the last column and find the latest version in the Version column); type in that number and hit enter (takes about 10 minutes to download).
sudo python3 installinstallmacos.py
- Open the downloaded image to mount it. You can close the window that opens and note that it probably won’t let you eject the image until rebooting the computer.
open Install_macOS_X.X-X.dmg
- Extract the bootpack below to this same folder ~/macOS-installer
And now you should have a directory named ~/macOS-installer that contains “content”, “EFI”, “Hac Tools”, “install_macOS_…”, and “installinstallmacos.py”.
C. Add SMBIOS content to config.plist
The bootpack file comes with empty slots for the SMBIOS content that needs to be modified with newly generated content.
- Start the script with the following command.
./Hac\ Tools/GenSMBIOS/GenSMBIOS.command
- Select Option 1 to download and update
- Select Option 2; find the config.plist from the ~/macOS-installer/EFI/OC folder in the Finder and drag it into the terminal window and hit enter
- Select Option 3; generate using the string “iMac17,1 5” and hit enter after it says it flushed it to the config.plist
- Select Option 5 to create a ROM number and copy/paste that into a text window for use later
- Select Q to quit
At this point, the config.plist is mostly complete but we still need to add in the ROM content.
- Run the plist editor with the following command.
./Hac\ Tools/ProperTree/ProperTree.command
- Use Cmd-O to open the config.plist in the EFI/OC/ folder
- Go to Root -> PlatformInfo -> Generic -> ROM and paste in the value copied above (it will already have the SMBIOS content now in the SMBIOS section). Note that it will format the hex value correctly when you paste it in.
- Cmd-S to save and Cmd-Q to quit
D. Create the MacOS Installer UFD
Now with the staging computer set up, it is time to build the USB Flash Disk (UFD) Installer.
- Run Disk Utility and immediately select View -> Show All Devices
- In the left navigation, select the Device for the UFD (the top level device) and click the Erase button in the toolbar.
- Enter name of “Monterey Installer”, select the format of “Mac OS Extended (Journaled)”, and select the scheme of “GUID Partition Map”. (If you don’t have the a partition choice, you probably have a partition selected in the left navigation rather than the device.)
- Click Erase (takes a minute, UFD is formatted)
- click Done
- note the “Device” name in the summary box – “disk1” or “disk2”, etc.
- quit Disk Utility
With the UFD prepared, it is time to write the Installer to it.
- Run the following command and expected it to take a long time. Enter Y to proceed.It took about 35 minutes for me on a not very fast UFD.
sudo /Volumes/Install\ macOS\ Monterey/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey\ Installer
Next we’ll set up the UFD to be bootable.
- Run this command. Find the entry in the list that matches the disk number you noted above after the UFD was created – e.g. if “disk2” for Device in Disk Utility, then enter the number for the option that includes “disk2s2”. Enter Q to Quit.
./Hac\ Tools/MountEFI/MountEFI.command
- I have found that the EFI partition on the hard drive remembers the open/close status of all of the child folders from the source. So I like to ensure all of the folders are closed in the ~/macOS-installer/EFI folders and all child folders.
- Copy the EFI bootpack with the prior modifications on to the UFD now. Note that the trailing slash here is really important because you want the EFI folder that is in the installer folder to be copied into the partition that is named EFI; the correct result will be /Volumes/EFI/EFI/OC…
cp -Rp ~/macOS-installer/EFI /Volumes/EFI/
- Copy the rest of the things we’ll use to do the install on to the UFD. Note that the target volume includes a “1” at the end because the Apple drive image is still mounted with the same name.
cp -Rp ~/macOS-installer/Hac\ Tools ~/macOS-installer/EFI ~/macOS-installer/python* /Volumes/Install\ macOS\ Monterey\ 1/
- Click the eject icon next to the EFI partition in a Finder window and click “Eject All”
E. Prepare Target Computer
In my case, the target computer was already at BIOS version A25. If yours is not, you’ll probably want to upgrade to it. I’m sure other versions of the BIOS will work but there are probably much older versions that would not and it’s easy enough to take care of that first.
- The first thing to do is configure the BIOS settings.
- turn on computer and hit F2 to get into BIOS
- Load Defaults, Apply, Exit
- hit F2 to get into BIOS again
- Secure Boot -> Secure Boot Enable -> Disabled selected
- General -> UEFI Boot Path Security -> Never
- General -> Advanced Boot Options -> Enable Legacy Option ROMs checked
- General -> Boot Sequence -> Boot List Option -> UEFI
- System Configuration -> Integrated NIC -> Enabled (the one with out PXE)
- System Configuration -> Serial Port -> Disabled
- System Configuration -> SATA Operation -> AHCI -> Yes
- Power Management -> Deep Sleep Control -> Disabled
- Virtualization Support -> VT For Direct I/O -> uncheck
- Apply, Exit
After hitting exit in the prior step, the computer will reboot. Be ready to hit F12 on this boot and every boot after this for a while. And note that when we boot, it will be from the UEFI section which will appear below the legacy section. If the UFD doesn’t come up in the list as an option, which happened to me, try doing the cp of the EFI content over again (step D11 above).
- computer boots, hit F12
- select the UFD device in the UEFI list
- on the OpenCore boot page, hit the space bar and select the option for modGRUBShell
- at the prompt, type the following lines (and ignore any warnings generated). The first two lines are important for all builds; the next 5 should only be needed for a Legacy (non-UEFI) boot but I did them anyway:
setup_var 0xDA2 0x0
setup_var 0x263 0x2
setup_var 0x2 0x1
setup_var 0x144 0x1
setup_var 0x15A 0x2
setup_var 0x146 0x0
setup_var 0x147 0x0
reboot
- computer boots, hit F12
- select the same UFD device to boot
- on the OpenCore boot page, select install MacOS Monterey
At this point we have modified the BIOS as needed and we have been able to boot into the Apple installer. You should see the Apple logo now!
F. Install MacOS
After it finishes starting, we’ll get the target disk ready.
- select Disk Utility and click Continue
- View -> Show All Devices
- select the disk you want to install on in the left navigation and click Erase in the Toolbar
- enter the name “MacOS” and leave Format as APFS and Partition Scheme of GUID, click Erase
- click Done
- Quit Disk Utility
You only need to create the one partition and the MacOS installer will take care of the rest. Now we can proceed with the installation.
- select install MacOS Monterey and click Continue
- Continue
- Agree, Agree
- select the disk you just formatted, Continue
MacOS install begins and it will say something like 20 minutes remaining but don’t go far because you will need to be around for each reboot. 15 minutes into the process, the screen may go blank but that’s just the screensaver kicking on. When the progress bar claims that there are 12 minutes remaining, it will reboot and you will need to hit F12 to select the boot device and choose the UFD again, then in the OpenCore boot page, select “macOS installer” this time. In the next few minutes, repeat that process 2 more times still selecting “macOS installer”; and then one more time it will reboot but this time select “MacOS”. In total, this will take about 40 minutes on a not very fast UFD.
When you finally get through all of the reboots, you’ll be greeted by the Apple Installer finalization steps.
- select country, click Continue
- select language, click Continue
- click Not Now
- click Continue
- click Not Now
- click Set Up Later, Skip
- Agree, Agree
- enter user info and password, click Continue (note that if you will be transferring an account later, enter non-conflicting account details here)
- click Continue, Don’t Use
- select location, click Continue
- deselect “Share Mac Analytics with Apple”, click Continue
- click “Set up later”
- choose look, click Continue
- click Continue (to setup keyboard) and select keys as instructed, click Done
The MacOS install is complete and you are now at the desktop!
G. OpenCore on Target computer
The installation of MacOS is complete but now we need to copy over the OpenCore content so that the new Mac will be able to boot without the UFD inserted.
- download and install python3 as you did on the staging computer
- Run the following in a terminal window to copy over the tools into the Utilities folder (so you can always have them available)
sudo cp -Rp /Volumes/Install\ macOS\ Monterey/Hac\ Tools /Applications/Utilities
- Now we will use the MountEFI to mount the MacOS drive’s EFI. Be sure not to select the installer’s EFI here. The drive you want is probably #2. After mounting, use Q to quit.
/Applications/Utilities/Hac\ Tools/MountEFI/MountEFI.command
- Now we will clean out the existing EFI content and replace it with the same EFI we used on the UFD.
rm -rf /Volumes/EFI/*(D)
cp -Rp /Volumes/Install\ macOS\ Monterey/EFI /Volumes/EFI/
- Eject the Installer UFD from the Finder and unplug it from the computer. You shouldn’t need that any more – but I typically keep mine in a drawer labeled as the installer in case I want to modify something later.
- My optical drives were making a sort of “burping” noise every 7 minutes or so. It seems that MacOS was drying to put them to sleep because it didn’t know they were not hard drives. I found that doing the following took care of that. Also, while at it, I wanted to make it so the computer would never go to sleep.
sudo pmset -a sleep 0
sudo pmset -a disksleep 0
Since we just got the latest version of MacOS when doing the installation, we should be able to do a system update safely (for me it was just Safari to update).
- Settings -> Software Update -> Update Now
- then click the Advanced button and uncheck the “Check for updates”, click OK
Now let’s reboot and make sure everything is working correctly.
- reboot and hit F12 (this should be the last time you need to do this) to select the drive that MacOS is on
- OpenCore will boot; if MacOS isn’t already selected, select it
- Settings -> Startup Disk, if MacOS isn’t selected, click the lock and change it
At this point, OpenCore should be able to boot the computer on its own so try one more boot to confirm.
- reboot
The computer should start on the correct UEFI selection, “OpenCore” now and when OpenCore runs, it should use the Startup Disk you selected in MacOS which should be the MacOS drive. And therefore, you should now have a fully functioning Mac. And if you installed Windows first, you should be able to select that instead when you boot in OpenCore.