My 2018 Mac mini (64G RAM, 2T SSD) has long been a trusty multi-VM pkgsrc and notqmail build machine, mostly via SSH. And during the first couple COVID years when I was still consulting independently but we were out of the country, it was also a trusty low-latency system for collaborative coding sessions with USA-based clients, mostly via screen sharing.
The mini still performs quite well. I still rely on it for keeping my NetBSD VPS running on the latest -current pkgsrc every week or so. But macOS NFS service had a tendency to be a source of annoyance and/or effort on each new major release. NetBSD’s NFS client got fixed, which was enough to get me by, but my Tribblix and Linux VMs had already been basically unusable for a while. And macOS had lately gotten a little unstable after reboot: sometimes misrendering the login screen, freezing after a correctly entered password, or suddenly pegging the fans for no apparent reason and powering abruptly off. So when macOS Tahoe dropped support for nearly all Intel Macs, I was already game to repave mine.
I generally prefer NetBSD when possible, and generally consider my non-NetBSD systems to be only temporarily so (e.g., Small ARMs).
Hosting a pile of nvmm-accelerated VMs while also building natively for my primary NetBSD production target would have been a solid use case.
But the 2018 mini has a T2 security chip that makes a bunch of basic onboard devices relatively difficult for an OS to attach, and Linux appears to be the only free OS that mostly deals with this.
Even then, we’ll need a T2-customized installer and special attention.
1. Prepare installer
$ cd ~/Downloads
$ bash <<<1 <(curl -sL https://github.com/t2linux/T2-Mint/releases/latest/download/iso.sh)
$ sudo dd if=linuxmint-*-cinnamon-*-t2-*.iso of=/dev/$YOUR_USB_STICK
$ rm -f linuxmint-*-cinnamon-*-t2-*.iso
2. Prepare machine
- Reboot and hold down Command-R.
- In macOS Recovery, choose Utilities -> Startup Security Utility.
- Secure Boot:
No Security. - Allowed Boot Media:
Allow booting from external or removable media. - Connect USB keyboard/mouse/Ethernet directly (not via Bluetooth or Thunderbolt dock).
- Quit Startup Security Utility.
3. Install
- Reboot and hold down Option.
- Choose your USB stick.
- In the live environment, open Terminal.
- Wipe, partition, and format the disk:
$ for i in \ "mklabel gpt" \ "mkpart ESP fat32 1MiB 513MiB" \ "set 1 esp on" \ "set 1 boot on" \ "mkpart Root btrfs 513MiB 100%"; do sudo parted $YOUR_DISK_DEVICE $i done $ sudo mkfs.fat -F32 -n ESP ${YOUR_DISK_DEVICE}p1
- In the live environment, run Install.
- Instead of “Erase disk and install Linux Mint”, choose “Something else”.
- Click the btrfs partition -> “Change…”.
- Use as:
btrfs journaling file system. - Format the partition:
[x]. - Mount point:
/. - ”Install Now” and follow the prompts until “Installation Complete”.
- DO NOT click “Continue Testing” or “Restart Now”. We’re not ready for the new install to be unmounted.
4. Tweak new install
- Enter newly installed environment:
$ for i in proc dev dev/pts; do sudo mount -B /$i /target/$i done $ sudo chroot /target
- From now on, track configuration changes in
git:# echo | apt install etckeeper # cd /etc # git branch -m pet-power-plant # git gc --prune
- Configure
grub:# echo 'GRUB_RECORDFAIL_TIMEOUT=0' > default/grub.d/60_skip_grub_prompt.cfg # etckeeper commit -m 'Skip grub prompt.' # update-grub
- Give Mac boot picker a custom icon:
# apt install libarchive-tools # curl -sL https://master.dl.sourceforge.net/project/mac-icns/mac-icns.iso \ | bsdtar -xOf- iconverticons.com/os_linuxmint.icns \ > /boot/efi/.VolumeIcon.icns
- Return to the “Installation Complete” dialog (finally!) and click “Restart Now”.
5. Before first boot
- When prompted, remove USB stick and press Enter.
- On reboot, hold down Command-R.
- In macOS Recovery, choose Utilities -> Terminal.
- Give Mac boot picker a custom label:
# diskutil list # diskutil mount /dev/$YOUR_EFI_SYSTEM_PARTITION_DEVICE # bless --folder /Volumes/ESP/EFI/BOOT --label "Linux Mint"
- Reboot and hold down Option.
- Observe the icon and label. Fancy! Someday you’ll hold down Option again, and this’ll help you disambiguate which volume you’re trying to boot.
6. First boot
- Go for it!
- Observe no
grubprompt, just straight through the Mint logo to the login screen. - Log in.
- Enable passwordless
sudo:$ echo '%sudo ALL=(ALL: ALL) NOPASSWD: ALL' \ | sudo tee /etc/sudoers.d/10sudo_nopasswd >/dev/null $ sudo chmod 440 /etc/sudoers.d/10sudo_nopasswd $ sudo etckeeper commit -m 'Skip sudo password prompt.'
- Allowlist your Thunderbolt dock, if any:
$ boltctl list # find your device's UUID $ sudo boltctl enroll --policy auto $YOUR_THUNDERBOLT_UUID
- Fetch WiFi and Bluetooth firmware:
$ sudo apt install dmg2img $ echo 7 | sudo get-apple-firmware get_from_online
- Connect Ethernet/WiFi/mouse/keyboard as you prefer.
- Enable T2 fan control and SSH service:
$ echo | sudo apt install t2fanrd openssh-server $ sudo systemctl enable --now ssh $ sudo etckeeper commit -m 'Enable sshd.'
- Update device firmware: (Note that the Mac’s EFI can’t be updated this way. The only way to update Mac EFI is as a side effect of installing the latest macOS.)
$ echo y | sudo fwupdmgr get-updates
- Follow the post-install Welcome prompts.
- In “Account details”, add my photo.
- Install some basics:
$ echo | sudo apt install tmux vim myrepos tig silversearcher-ag qemu-system-x86-64 kdeconnect dropbox
7. Back to work
- Mount source trees from NAS. (Oh hey, I finally have a NAS! Similar post forthcoming about that.)
- Create a NetBSD VM to match my production VPS.
- Build a fresh batch of packages.
- Carry on with life.
I’ve got some older Mac minis that may also soon find gainful employment around here.
