Asahi Fedora on the Apple MacBook

…for fun and work

Christian Horn, https://fluxcoil.net

@Tokyo Linux User Group, November, 2024

Questions? Just ask.

Mac&Onigiri

Slides also hosted at:

https://asahi.fluxcoil.net/

Agenda

  • What I use the Asahi macbook for
  • What’s Asahi Linux?
  • Pros/cons of deciding for a Mac w/ Asahi Linux
  • Debunking some myths around Apple and Asahi Linux
  • Asahi installation, essential features
  • First things to do after installation
  • KVM virtualization/qemu emulation
  • Hints/issues to research and conclusion

What I use the Asahi macbook for

  • Daily work: #engineer #support #communication
  • Firefox, Slack, Google-{meet, drive, docs}
  • Google Chrome -> chromium
  • LDAP company directory access, OpenVPN, print
  • Kerberos authentication: browsers, command line tools
  • Devel work in upstream: compile, use git etc.
  • mutt, ImageMagick, irssi, Gimp -> Krita, pandocs, LaTeX
  • KVM guests to replicate customer issues, deployed via kickstart and Ansible

Asahi: Linux on Apple silicon

  • Asahi Linux: project to get AppleSilicon (aarch64 based) cpus supported on Linux. Nowadays the default is to run Fedora + Asahi repos. Other distros exist. Marcan, main developer, is sponsored via Patreon, not by a company.
  • M1 generation: most features supported, M2: more performance, but was released later - fewer features supported on Asahi. M3/M4: at some point.
  • Asahi feature support page, monitor as feed in your news fetcher: https://github.com/AsahiLinux/docs/wiki.atom

Mac with Asahi pros/cons

  • My past desktops were x86, with side quests. On x86, I know my way around, it’s widely tested, much help on the net.
  • AppleSilicon:
    • AppleSilicon is known for good performance
    • screens are better than our Thinkpad screens
    • they also cost twice the price of the Thinkpads
    • my use cases were at that point covered on Asahi Linux
    • Choosing a Mac allows to get deeper involved with aarch64. I’m into exotic hardware: my router is RISC-V (star64), my Nintendo Switch has run more hours on Linux than with ‘Legend of Zelda’

Employees in Japan can keep old hardware for a while, I would have a fallback. So, I asked for a MacBook M1/32GB as hardware refresh!

… received: M2/16GB, :-/

Debunking some myths..

  • Apple reinvented all the things!
    • Yes, AppleSilicon (‘AS’) is Apples own ARM design. All ARM designs are quite different from each other. The disk layout of AS Macs with OS-containers is complex, but carefully designed so Linux and other OSs can co-exist along with MacOS. It also allows each of them ‘secure boot style’ booting.
  • Apple can kick out Asahi at any time!
    • They could, but over the last years we have not seen signs they will. Rather the opposite, that they are interested in having Linux@AS available for their clouds, which for example run Apples AI models used by iPhones etc.
  • The performance isn’t that great!

Asahi installation

  • Fedora Asahi remix install script
    • For me: minimal install with Fedora 39, then install Sway window manager
    • Asahi default experience: KDE Plasma
    • there is also a Asahi/Gnome community
  • Overall install procedure:
    • Run Installer, it sizes down MacOSX OS-container, creates new OS-container, installs Asahi Fedora remix
    • You then create a bootable media, i.e. on usb stick
    • boot from the stick, encrypt the Asahi installation (onthefly!)
    • The details
  • Later upgrade to Fedora 40: not upgraded at beta phase as usual, but weeks later after Asahi flagged the upgrade as ‘ok’

Important Features, 1 of 2

  • Screen brightness setting via package (and command line utility) ‘light’ works, rj45 ethernet via USB-C connected docking station
  • webcam, webcamtests.com for first tests
  • Wlan, Bluetooth, Fcitx5 for Japanese input
  • KVM: virtualization for aarch64, or emulation for x86. Emulation is much slower, but usable for my purposes
  • 3.5mm sound jack
  • HDMI output was implemented December 2023, HDMI-audio might have glitches. Before December 2023, I investigated encoding and sending to a different system like Raspi

Important Features, 2 of 2

  • Skype via web.skype.com : complains that it’s not running in browser “edge”. Does run on Firefox, with a bit of lag - maybe bad codec choice? Working around in using Android phone.
  • Buildin speaker: supported since December 2023 speakersafetyd, written in rust: physical model to get the maximum out, while the hardware stays within limits
  • There is the “ANE driver” for Neural Network Engine on Asahi, getting that wider supported would also be nice for running local models.
  • Not yet working:
    • monitor output via USB-C (but HDMI-output works)
    • builtin microphone (but I use the Sony bluetooth headset anyway)

First things after installation, 1 of 2

  • Asahi focuses on Wayland, get used to it. “We should simply have called it Xorg5 instead of Wayland”
  • Asahi default is KDE Plasma. I use Sway, my first steps install sddm (login manager), Japanese fonts, vim, details
  • Then:
# add your user to video/audio groups.
# Required so chromium can access camera, etc.
usermod -G audio,video chris

# Lightup keyboard leds
echo 5 >/sys/class/leds/kbd_backlight/brightness
# Turn off keyboard leds
echo 0 >/sys/class/leds/kbd_backlight/brightness

First things after installation, 2 of 2

  • Touchpad config you might want to apply
  • There is no build of Google Chrome for aarch64. So far I used Google Chrome for company related video chat etc, had only the company google user there. Chrome also seemed to work more smoothly with google meet, which I have to use for the company. Using Firefox/Chromium now instead.

KVM virt/emulation

  • aarch64 virtualization: blazingly fast, rhel9+
  • via qemu x86 emulation, all else can be run: rhel6/7/8
  • Apple ships extra code with MacOSX, providing faster x86 emulation in some corners, details on the wiki. Steam/x86 running since some weeks, making quite some games available.
  • Memory is a topic. I’m hitting 14GB when running firefox/chromium and a 2GB memory guest.
  • As RHEL10 glibc requires the x86-64-v3 instruction set, qemu needs to emulate newer cpu arch: “- -cpu Icelake-Server”
  • Details on installing virtualized and emulated guests

Hints / Issues to research, 1 of 2

  • Cut’n’paste changed:
    • normally I used 3rd mouse button for pasting
    • but the MacBook has just this one touchpad, no buttons
    • now, ‘clicking with 3 fingers’ replaced for me clicking the middle mouse button
    • alternative: ctrl+shift+v
  • I used crtl+pageup and ctrl+pagedown on other keyboards to switch through browser tabs, these keys do not exist - need to find replacements

Hints / Issues to research, 2 of 2

  • When using HDMI external monitor, disabling internal screen, then disconnecting HDMI screen/turning on internal screen, then going to external screen, fonts in alacritty terminals get rendered in a rough/unsharp way. Not sure if sway/alacritty/wayland or Asahi issue.
  • Slack: only the official software from them (which is just a certain blessed chrome version) offer “hoodles”. Potential alternative: use ‘nativefier’ to encapsulate a webapp

My conclusion for now for Linux@AppleSilicon

  • All important pieces are there: encrypted disk, openvpn access, wlan/ethernet, access to mail, video conferences.
  • It’s less tested than x86, I had situations when wlan was not working and wpa_supplicant needed to be downgraded
  • The Macbook hardware is quite nice, the screen great, compared to my Thinkpad T590. Performance Co-Pilot compiles in under 6min. For replicating customer issues, virt/emulation run ok. Battery life time is great.
  • The keyboard + touchpad need to get used to.. external keyboard + mouse are possible.

Questions? Questions!

Asahi@Mac