Table of Contents

MacOS

Useful tools

I use a MacOS (Intel) on the side, so some tools that may be useful. Avoid exposing the system Python if possible, and use pyenv instead.

# Install brew
# Refer to the official docs, typing here only for my convenience
user:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
user:~$ brew update
user:~$ brew install pyenv
user:~$ brew install openssl readline sqlite3 xz zlib tcl-tk
 
# MacOS from Catalina and up uses zsh instead of bash
# so write the pyenv injections into .zshrc and .zprofile instead
user:~$ echo $SHELL
zsh
user:~$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
user:~$ echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc\
user:~$ echo 'eval "$(pyenv init -)"' >> ~/.zshrc
user:~$ cp ~/.zshrc ~/.zprofile

Difficult to find software that can read temperatures:

For ffmpeg installation, pull the static build for MacOS from FFMPEG website, then copy to /usr/local/bin. Problem is MacOS has some extended permissions model, so need to (1) allow from "Privacy & Security" settings after running and being blocked once, (2) run it again and select allow on two additional pop-ups. Repeat for ffprobe and ffplay.

Other software:

Mounting volumes

Exceptionally great guide on using automount utility to mount drives on boot, here. This is immensely useful is conveying stability of network share to Mac users who just want it to work.

> cat /etc/auto_master
+auto_master
...
/-      auto_smb        -nosuid,noowners
/-      auto_afp        -nobrowse,nosuid

> cat /etc/auto_smb
/System/Volumes/Data/mount/{{MOUNT_DIR}}	-fstype=smbfs,soft,noowners,nosuid,rw ://{{USERNAME}}:{{PASSWORD}}@{{IP_ADDRESS}}:/{{MOUNT_PATH}}

# Set read-only (MacOS extended attributes for 'auto_master' to prevent overwrite)
> sudo chmod 600 /etc/auto_smb
> sudo chflags schg /etc/auto_master

> sudo automount -cv

Think there is a non-command line method, but figured would be good to know the fundamentals.

Creating an ISO from the App image

Most of the content came from here. First download the MacOS installers from the App Store, links here.

# Create a filesystem (or is it disk image?), then attach and mount it
user:~$ hdiutil create -o /tmp/Ventura -size 16384m -volname Ventura -layout SPUD -fs HFS+J
user:~$ hdiutil attach /tmp/Ventura.dmg -noverify -mountpoint /Volumes/Ventura
 
# Run script to write disk image contents to mount
user:~$ sudo /Applications/Install\ macOS\ Ventura.app/Contents/Resources/createinstallmedia --volume /Volumes/Ventura --nointeraction
user:~$ hdiutil eject -force /Volumes/Install\ macOS\ Ventura
 
# Convert DMG to ISO
user:~$ hdiutil convert /tmp/Ventura.dmg -format UDTO -o ~/Desktop/Ventura
user:~$ mv ~/Desktop/Ventura.cdr ~/Desktop/Ventura.iso
user:~$ rm -f /tmp/Ventura.dmg

https://klabsdev.com/definitive-guide-to-running-macos-in-proxmox

Running different OS on Apple devices

Changelog

  • 2024-06-19: Init for Mac Mini (Intel, 2018)

Boot the computer. When the startup sound is heard, press and hold Alt to open up the Startup Disk menu. Typically will have the main MacOS partition, as well as a "GRUB" MacOS recovery partition. The last one is probably the external boot you want.

Booting likely cannot be performed if the BIOS explicitly disables this, which is likely the default for Apple devices. In this case, first press and hold Cmd-R (Win-R) and then under the Utilities submenu open the "Startup Security Utility". The BIOS is locked with the admin user credentials of the MacOS.

Network IP addresses

Ideally grep can do regex, but this flavor doesn't seem to support. In any case the ideal query string:

macos ~ % ifconfig | grep -P "(inet |mtu)"
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	inet 127.0.0.1 netmask 0xff000000
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
anpi1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
anpi0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
en3: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
en4: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ap1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet 192.168.1.13 netmask 0xffffff00 broadcast 192.168.1.255
awdl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000
utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
utun3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
utun4: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
utun5: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
utun6: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
utun7: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1350
	inet 100.64.100.6 --> 100.64.100.5 netmask 0xffffffff