macOS - first experiences from a Linux user perspective
A while back I took delivery of a Mac Mini M1 system ("2020" model with 16Gb RAM running MacOS 11.6 "Big Sur" (It's now on 12.3). It came with no keyboard, mouse or screen (but I had plenty of them around, including a Unicomp Model M buckling spring keyboard with mac keycaps which I'd acquired a few months previously!) First problem was that the HDMI output didn't seem to want to talk to the 1600x1200 screen I had on my desk, so I switched it over to my 27" 1080p display ...
So what's it like to use? I've used macOS systems as servers before but other than a small amount of GUI remote access I hadn't seriously used a desktop system before so I wanted to share "first timer" experience for some common use cases as a developer. Oh, and it's quick. Really quick. Whatever Apple have done in designing the M1 ("Apple Silicon") CPUs which are Arm64 they've done an amazing job and left very little room for criticism. It is a big.LITTLE setup with four high performance cores and four energy efficient ones and, somewhat surprising to me, also implements seems to natively implement the (optional) 32-bit Arm instructions - useful if you want to run Linux containers for that architecture.
Start with a terminal (obviously!)
From there the Terminal icon can be clicked to start or (recommended) dragged into the "dock" at the bottom of the screen so it's always there when you want it. If you want to launch another one, you need to left click to start a new terminal window, or you can use CMD+T to open a new tab in the existing window. To switch between tabs in the terminal, use CTL+Tab and CTL-Shift_TAB rather than CTL-PgUp/PgDn as it often is elsewhere. Note that the first time you access some of the new folders withing the terminal shell you'll get a popup dialog saying that "Terminal" would like to access files in your <directory> folder. Your terminal does not have access to everything under your user ID by default.
Navigating the keyboard and window management
While if you're new to macOS it seems strange not to have menu bars on each window but instead they are all in a bar at the top of the screen that adjustsitself based on the application you're currently using. I'd used it on remote systems enough that it didn't bother me but it's the most ovious difference in the macOS UI compared to others. The other thing to remember if you're coming from another machine is that while Mac keyboards do have a "Ctrl" key it's generally not used and most of the operations which you'd use Ctrl for on another system are done with one of these two keys instead
- Command (or Cmd) ⌘
- Option (or Alt) ⌥
If you're using a UK keyboard, the keystroke for the # character is Option+3. The Euro symbol € can be found at Option+2 if you need it.
Finding your way around the system
The Apple logo is always leftmost in the menu bar at the top of the screen and gets you to the sleep/restart/shutdown/lock/logout options as well as the apple "App Store" for installing apps and also "System Preferences" which has most of the system options. The "Activity Monitor" and system "Console" (which shows you crash dump info) are not in the System preferences - for those you need to navigate to the "Utilities" directory with the Finder app - they're in the same place you used to launch the terminal window.
In System Preferences you can enable remote ssh connections. To do this, go to "Sharing" in the System preferences and check the "Remote Login" checkbox. On the top of the sharing page you can also set the hostname to something better if desired. "Screen sharing" in the same panel will also allow you to connect over VNC if you so desire (You can use "open vnc://<ip address>" from another mac to connect or try another client)
There is no auto-focus functionality but this third-party tool apparently allows it, and if you set it up appropriately it can auto-focus but not raise to the front on focus if that's what you want.
Keyboard shortcuts
As mentioned earlier, many of the keys are the same as on other systems but use the Cmd" button rather than "Control" e.g. Cmd+X/C/V is cut/copy/paste. Command+Space brings up the Character viewer for inserting emojis etc. and Shift+Cmd+5 brings up screen capture/recorder. Command+comma brings up the current app's preferences. A full list of shortcuts is at https://support.apple.com/en-us/HT201236
Try not to hit the Ctrl key twice as that will attempt to initiate dictation (Not much use without a microphone)
There is no default keystroke for maximizing a window but I set mine to CTRL+Cmd+Up via System Preferences -> Keyboard -> Shortcuts -> App Shortcuts and setting a new one for a menu title of "Zoom" Ref: https://apple.stackexchange.com/questions/372719/maximize-window-shortcut#372732
A few essentials to download for serious work
I wanted the consistent experience of using Firefox as my primary browser so I grabbed that from https://www.mozilla.org. Note that videoconferencing tools did not work well for me under FireFox using an external USB camera - the sound is quite garbled/robotic apparently like the sound in Beastie Boys 'Intergalactic' according to my colleague Beth - but it's ok in Safari so I've had to stick with that. I also needed virtualisation software. VirtualBox (many people's favourite) isn't available, and VMware Fusion and Parallels cost money, so one remaining option which is based on qemu is UTM from https://mac.getutm.app. This gives you a fairly basic GUI over the top of QEMU, and unlike the other solutions it lets you start up VMs of different architectures as well as the native aarch64.
Also while I'm trying to do everything natively, if you try to run a macOS application which has not been converted to aarch64 macos will prompt you to install Rosetta2 which is their dynamic translation layer for x86-64 macOS apps which is provided for backwards compatibility. Alternatively you can explicitly install it with:
- softwareupdate --install-rosetta
But bear in mind that installing Rosetta 2 is a one way thing - you can't easily uninstall it afterwards (This may work though). If you want to use it, but keep a separate environment for testing without Rosetta, you might wish to consider running macos on macos using the Virtualization framework. If all else fails, you can always factory reset the mac. (TL;DR for reference because I've done it a few times: Shut down, Switch on but hold power button, Options -> Continue -> Log in -> "Reinstall macOS"
And now for the other UNIX OSS tools - brew
Many other pieces of UNIX software can be installed using the brew utility. You can download this from the brew.sh website. brew acts like a package manager, and installs software into "/opt/homebrew" on aarch64, or /usr/local on x64 (You can also install brew on Linux, in which case it uses /home/linuxbrew/.linuxbrew) If you are willing to risk running shell scripts from the internet, then use this command to install brew onto your host:
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Containers with Docker (or podman)
- brew install podman
- podman machine init --cpus 7 --memory 8192 --now
- podman machine init --cpus 7 --memory 8192 -v $HOME/map:/map
- docker run -it -v /map:/map ubuntu bash
All in shot at once - my (non-phone, non-@Raspberry_Pi) ARM machines in once place - clockwise from left:
— Stewart X Addison 🇪🇺 (@sxaTech) June 14, 2020
- @nvidia JetSon Nano - 4GB 4*A57@1.43Ghz+128 core GPU
- #BeagleBone Black - 512Mb 1*A8 @ 1GHz
- ODROID-XU4: 2GB 4*A15@2GHz+4*A7
- ODROID-N2 - 4GB 4*A73@1.8GHz+2*A53@1.9GHz pic.twitter.com/sdZa3Bg1E4
Compiler tools - Xcode or the cut down command line tools?
File Types
- .pkg - Application installer. Double click or "sudo installer -pkg package.pkg -target /"
- .dmg - Compressed disk image format - double click then comy when prompted or mount with `sudo hdiutil attach file.dmg` - find it under `/Volumes` then copy the contents of the `.app` directory to `/Applications`.
- .xip - file that can be extracted with `xip -x` - Note that if you do this in an empty directory you'll have to use `cd $PWD` to see the extracted data (!)
macOS on macOS with the Virtualization Framework
VMIP=`arp -a | grep 192.168.64 | grep -v 192.168.0.255 | tail -1 | awk '{print$2}' | tr -d '()'`
The first time you do this you may also have a failure relating to signing - if so click the top level of the project in the left navigation in the Xcode UI, click the problematic application under "TARGETS" then go to the "Signing & Capabilities" tab where you will be able to select a "Team". Similarly if you get a problem with it saying that the macos version is incompatible, use the "macOS Deployment Target" section of Build Settings to make sure it matches your host system.
Not allowing an Apple ID to work properly in a virtualised MacOS system using Apple's virtualisation framework running on an Apple Mac seems completely ridiculous ... https://t.co/AeQDUgXWxR
— Stewart X Addison 🇪🇺 (@sxaTech) February 18, 2023
Comments
Post a Comment