Monday, October 10, 2022

Triple boot iMac with Snow Leopard, El Capitan, and Batocera... Notes, Tips, Tricks, and Hints

Well, well, well.   I think I got it?  Use my notes at your own risk.  BACK UP BEFORE PARITIONING AND ERASE HD DATA!

Here's the basics for creating a triple boot Batocera on Intel Mac...  probably most iMacs, Macs, MacMini's, MacBooks, etc.

1. Find a wired keyboard.  If a windows one, remember "Windows" = "Apple/Command".
2. Create/validate 4 partitions... 
- A Rosetta capable MacOSX like Snow Leopard. 
- The lastest MacOS that runs on your hardware (it was El Capitan for me).
- A MSDOS-Fat32 partition of about 5-10 GB that is named "BATOCERA"
- A ExFAT partition named "Userdata".

3. Download Batocera for Intel Macs here https://batocera.org/download.
- Expand and open the .img.
- Copy everything from that image to your BATOCERA parition.
- (BalenEtcher is not required.)

4. Install rEFInd (you might need to use your Recovery Partition or a USB boot disc to get to Terminal to install if SIP is enabled.)  https://www.rodsbooks.com/refind/

5. Verify in Files that it found the Userdata partition, and then use the EmulationStation Developer menu item to run "Format" on the "Internal" drive to EXT4 format.  Reboot.

6. Add roms and have fun!

That's it.  The wordy section with tips and pitfalls follows.  Thanks


----------------wordy section------------------


I saved an iMac with 3GB of memory and a 320 GB drive and a dual core Intel processor from the dump.  A friend got it for $10 and couldn't figure out how to fix and flip.  I got into it, made a boot USB for the OS's I wanted, and got it all repaired and fixed.  (The max Rosetta/MacOS9 compatible OS is Snow Leopard, so that's one 120 GB partition, The max OS for this OS is El Capitan, so that's next at another 120 GB, then I have a 10 GB FAT partition for Batocera, and then finally 70 left for the Userdata partition.

I didn't find a lot of information on how to set up Batocera on a dual boot Mac from google, and so I thought I'd document what worked.  (Note: Some message boards forward you to this page... https://wiki.batocera.org/dual_boot_ubuntu_batocera.linux  But, that doesn't have ANY information for MacOS and is written like this dual boot stuff is all horribly impossible and ill advised.  But, with what I did below, well...  it ended up working just fine.)

As with a lot of these dumps, this is not going to be highly formatted or pretty.  I just wanted to get it all down before I went on to the next thing.

1. Windows keyboards on Mac...  The windows key is the command/"four circles weird icon"/Apple key.  Also, a wireless Logitech doesn't always work for the Command-R (to start in recovery mode) or the very important Alt (to start in boot picker) methods of holding those as the computer restarts.  So, having a wired keyboard during this is important.  (Once you are booted to the mode you want, everything is fine...)

2. Getting the partitions right.  Ugh.  (You'll probably want to put windows on your machine.  I just didn't do that.   But shouldn't have any issue. But, it's a really old mac and I have lots of windows machines.)  So, I was focused on having a solid Rosetta machine again to run old stuff.  I always regretted updating past that.  Regardless, you can do as many partitions as you want.  Except for that the partition manager is really weird and wonky on the Mac DiskUtility.  

What I finally figured out through all of this was that the way to "fix" issues where the partitions won't get set, is to just take the last MacOSJournaled partition and have it reoccupy all the remaining open space by deleting all the partitions that aren't just working right.  

Once you've done that... it's actually simple.  

2. a. Just select the last MacOSJournaled partition that is too big and has free-space, and hit "+" and then "+" again.  Then resize those as you want.  And on the 2 new partitions... I HAD to partition them as MacOSJournaled FIRST.  Every time I tried to go straight to the formats I wanted... then it failed.

2. b. But if you get the partitions right with MacOSJournaled _THEN_ it's time to change them and rename them.  So, call the first tiny one BATOCERA and formatted it as FAT.  (I made it 10GB to prevent against future expansions).  

2. c. And then I called the bigger one "Userdata" and formatted it as EXFAT (for now... we'll fix that to EXT4 cause FuturePinball - https://wiki.batocera.org/systems:fpinball says it prefers that, even though I assume this computer is too slow for that.)

So, now, you should have all your "legit" partitions for MacOS versions and Windows and Linux versions... and then for me... 

To summarize step 2... I made my last 2 partitions... "BATOCERA" (MS-DOS FAT) and "Userdata" (ExFAT)...  Which is how ye old USB partitions look when you make a USB drive.

(NOTE: This method _really_ scared me and confused me.  I thought I could just install this on BATOCERA as a BIG ASS FAT32 DRIVE cause that's what mounted on the USB stick I'd made at first... But one big FAT32 drive had no space when I did ROM transfer... but that's because of how "Userdata" works... it's a separate partition with lots of space that is leveraged by the BATOCERA Linux boot.

I found one thread that clued me into this all here: https://wiki.batocera.org/batocera.linux_architecture  And it very clearly explains that you need 2 partitions!  I should have had that _duh_ moment, but I didn't because I'd read that horrible link I crossed through up at the start.  I thought somehow that "Userdata" was materialized by magic by the first launch.  I thought it would maybe create a rogue Userdata that took over my good partitions.  I was scared.

I spend at lot of time switching between "External" and "Internal" and the various drives that EmulationStation offered.... But, what _I_ wanted was MacOS installed on my harddrive.  No USB or external or network stuff.  Just _there_ whenever I wanted to boot in.  So, 2 partitions is the trick.  (Spoiler, first boot with "Userdata" as a partition existing... IT FOUND IT AUTOMATICALLY when "internal", the default, is set in Emulation Station.))

Where was I.  Ok, so, I have my partitions.

3. Next step, go to https://batocera.org/download and get the MacOS Intel version.

3. a. (NOTE: Do they want you to use BalenEtcher to install and all that in the documentation???  yeah, they do.  But do you need to???  Not really.   Not really at all.  Why???  BECAUSE... Emulation Station has a very scary formatting utility built in.  Ack!  So, you don't actually need to do anything but dump the Image's BATOCERA data into the BATOCERA partition.  That's it.)

3. b.  Just open the .img, and you'll get _only_ BATOCERA... Just copy all the files (batocera-boot.conf, and the folders boot, EFI, and tools) over to your partition... also named BATOCERA.

3. c. But but but... they said to use BalenEtcher.  I know.  But, you don't need to.

4. At this point, you will probably have gotten here because you're struggle and have had to hold "ALT" about a million times to play with things.  Here's part of what makes all this weird... most of the guides and message board posts whine about not being able to have a graceful autoboot menu by default.  That's because they haven't messed with rEFInd.  (https://wiki.batocera.org/dual_boot_ubuntu_batocera.linux, the x'd out link above, does mention rEFInd, but it's under an "iOS" section and makes it sound like you'd better hope and pray it finds your partition.  Poppycock.  Not sure who wrote that, but it clued me into reading about the utility, and it's great.)

4. a. rEFInd... Set up the boot menu with an amazing boot utility that replaces the "hold ALT during reboot" with a cool booting utility by Roderick W. Smith.  https://www.rodsbooks.com/refind/  Go ahead and get that.  The documentation is wonderfully verbose and accurate.  I had to use the SIP workaround in bash at the terminal after booting from an install USB because my recovery partition wouldn't boot (likely because this dang computer had a hell of a hard life and had something go corrupt on the original owner in the boot sequence - They messed up something somehow... anyway...).  If you can be methodical and follow directions, it is doable.  I highly recommend it so you can have your Mac boot the way you want.

5. So, now it's time to boot up BATOCERA with rEFInd.  Once you're in, it's too loud (hope you're keyboard has volume controls on it), and then it's too loud again.  You'll wake up the wife.  

5. a.  It will take a long time your first time, as I assume it's going ahead and creating the default files and folders on Userdata.  (You will be destroying them in a second.)

5. b. Once you have the interface, hit the F1 key and go to the file browser.  Make sure that when you go to Roms or Bios or Userdata, that the free size on all of them is what you made that partition.  (In my case, it was the 70 GiB partition.)

5. c. For sure for sure make sure that's right.  Cause, the next step is for you to delete it and put EXT4 on it!  So, the way you do this is to quit Files, and then hit space bar, and then go into the Menu.  As documented by the amazing link here: https://wiki.batocera.org/batocera.linux_architecture , you can then follow it's advice to go to Menu -> System Settings -> Frontend Developer -> Format. 

5. d. Ugh... Formatting is scary.  Scary scary.  But, remember... You made your partitions.  You defaulted to "Internal" as the location.  And, most importantly, you did step 5. b. and verified that the "Internal" partition it found was indeed Userdata because the size of the drive matched the size of your partition.

5. e. You are making regular backups of your main system, right?  And you did before you started partitioning everything, right?  Right?

5. f. So, go ahead and format it to EXT4.  And ta-da, it happens so fast, you barely realize it.

5. g. This is where I point out that it seems like _ANY_ EXT4 capable partitioning software will work.  But, most guides need all sorts of Ubuntu USB or MacFUSE installs or what have you...  And this built in functionality works great after you get over being scared.

6. So, that's pretty much it.  Reboot into batocera, and see that, now, tada, you now have an EXT4 userdata drive.  The MacOS won't love it (unless maybe if you use MacFUSE), but who cares.  Moving ROMS is super simple using the myriad of guides for either using \\BATOCERA or using FTP or using SMB or what have you.  The only downside of course is that you'll need an extra computer or laptop to interface...  This is where an Ubuntu boot USB or MacFUSE might help... and also... I haven't tried mapping the other drives as I'm not a linux-y kind of guy.  If that is you, it might work.

6. a. Note: YOU GOTTA TELL EMULATIONSTATION TO HOOK UP TO YOUR WIFI NETWORK MANUALLY THROUGH THE MENU all the time.... Ugh...


Anyway, I hope that long ass wordy guide helped someone struggling/scared with making a dual boot Mac that runs Batocera.


Good Luck!

How to set up a self booting dedicated Moonlight (Sunshine client of Nvidia's GameStream) on a Raspberry Pi 3B+

8/11/2024:  This guide shows you how to set up a Raspberry Pi 3B+ (and older?) to stream your desktop PC from anywhere on your home network ...