r/linux_on_mac • u/listbox • 10h ago
r/linux_on_mac • u/knightwize • 9h ago
Turning a 2004 Macbook (Snowbook) into a writing station ( a work in progress).
knightwise.com
r/linux_on_mac
•
u/Acceptable_Second_50
•
20h ago
Debian 13 on a 2017 12-inch MacBook: I finally got hibernation working
I've been running Debian 13 on my 2017 12-inch Retina MacBook for a while now. Most things have been working pretty well, but there was one problem I had practically given up on: sleep and hibernation.
Every time I tried normal suspend, something would go wrong when the machine woke up. Sometimes the keyboard or trackpad wouldn't respond, and other times I had problems with the display or other hardware.
Eventually, I disabled suspend altogether. Closing the lid would turn off the screen, but Debian kept running in the background.
Not exactly ideal for a laptop.
A few days ago, I came across this Debian discussion and the accompanying MacBook8,1 sleep/hibernation guide.
That got me interested in trying again.
My MacBook is a different model, so I couldn't simply copy everything. After several tests, some mistakes, and a fair amount of troubleshooting, I finally have it working.
Here's what I did.
My hardware
- Apple MacBook Retina 12-inch, 2017
- Model identifier: MacBook10,1
- Debian 13 (Trixie)
- GNOME / Wayland
- Kernel: 6.12.117+deb13-amd64
- 8 GB RAM
- 256 GB Apple SSD
- Broadcom BCM4350/5 Wi-Fi (
brcmfmac) - Apple SPI keyboard and trackpad (
applespi)
One important difference from the 2015 MacBook8,1 is the SPI controller.
Mine uses:
0000:00:1e.3 Intel Sunrise Point-LP Serial IO SPI Controller
Kernel driver: intel-lpss
SPI device: spi-APP000D:00I decided not to touch the SPI controller or modify the applespi driver.
Instead of trying to fix normal suspend, I wanted to see whether direct hibernation could avoid the whole problem.
1. Checking hibernation support
First, I checked what the kernel supported:
cat /sys/power/state
cat /sys/power/mem_sleep
cat /sys/power/diskResults:
freeze mem disk
[s2idle] deep
[platform] shutdown reboot suspend test_resumeSo hibernation was available.
My machine already had these kernel parameters from previous troubleshooting:
mem_sleep_default=s2idle i915.enable_psr=0I left them unchanged. I haven't tested whether removing them affects hibernation.
2. Configuring the swap partition
My Debian installation already had two swap areas:
- A dedicated swap partition, approximately 7.9 GiB.
- An additional 8 GiB swap file.
The swap partition was /dev/nvme0n1p3.
I identified its UUID with:
sudo blkid /dev/nvme0n1p3Then configured /etc/initramfs-tools/conf.d/resume:
RESUME=UUID=<YOUR-SWAP-PARTITION-UUID>Obviously, replace the placeholder with the UUID of your own swap partition.
After that:
sudo update-initramfs -u -k "$(uname -r)"For the initial tests, I disabled the additional swap file:
sudo swapoff /swapfileThis left the dedicated swap partition available for hibernation.
A word of caution: my swap partition is only slightly larger than my installed RAM. It worked during my tests, but it may not be sufficient under every memory workload.
3. Enabling hibernation in systemd
This was my first obstacle.
Some time ago, while trying to stop the suspend problems, I had masked the systemd sleep targets.
When I tried:
sudo systemctl hibernateI got:
Call to Hibernate failed: Access deniedThe journal explained why:
Unit hibernate.target is masked, refusing operation.I fixed that with:
sudo systemctl unmask hibernate.target sleep.target
sudo systemctl mask suspend.targetThis allowed hibernation while keeping conventional suspend disabled.
I tried again:
sudo systemctl hibernateAnd it worked!
The MacBook powered off and restored my previous desktop session when I turned it back on.
Unfortunately, the built-in Wi-Fi had completely disappeared.
Restarting Debian brought it back, but that obviously wasn't a workable solution.
4. Getting Broadcom Wi-Fi back after hibernation
My wireless chipset uses brcmfmac, along with brcmfmac_wcc.
Initially, I tried unloading and reloading the driver manually, but got:
modprobe: FATAL: Module brcmfmac is in use.Eventually, I created a systemd sleep hook to handle the driver automatically.
It stops NetworkManager before hibernation, attempts to unload the Broadcom modules, and starts everything again afterward.
First, create the directory:
sudo mkdir -p /usr/lib/systemd/system-sleepThen create the script:
sudo tee /usr/lib/systemd/system-sleep/macbook-wifi >/dev/null <<'EOF'
#!/bin/bash
LOG=/var/log/macbook-wifi-hibernate.log
log() {
echo "$(date '+%F %T') $*" >> "$LOG"
}
case "$1/$2" in
pre/hibernate)
log "PRE: preparing Broadcom"
systemctl stop NetworkManager
for i in {1..10}; do
modprobe -r brcmfmac_wcc 2>>"$LOG"
if modprobe -r brcmfmac 2>>"$LOG"; then
log "PRE: Broadcom unloaded successfully"
exit 0
fi
sleep 1
done
log "ERROR: unable to unload Broadcom"
systemctl start NetworkManager
exit 1
;;
post/hibernate)
log "POST: restoring Broadcom"
modprobe brcmfmac >>"$LOG" 2>&1
systemctl start NetworkManager
log "POST: restoration finished"
;;
esac
EOF
sudo chmod +x /usr/lib/systemd/system-sleep/macbook-wifiThe script also creates a log at:
/var/log/macbook-wifi-hibernate.logThis was useful because whenever Wi-Fi disappeared, I had to restart the MacBook before I could continue investigating.
With this script installed, the internal Broadcom Wi-Fi started working again after hibernation.
I haven't tested the script with other Broadcom chipsets, so I wouldn't assume it works universally.
5. Another problem: Nautilus
During testing, one hibernation attempt failed with:
Freezing user space processes failed after 20.004 seconds
(5 tasks refusing to freeze)Looking through the kernel journal, I found blocked processes belonging to Nautilus:
task:pool-38 state:D
task:nautilus state:DMy Debian setup uses GNOME Online Accounts, including Microsoft accounts, and GVFS exposes some remote volumes through Nautilus.
I suspect a remote filesystem operation may have been involved, but I couldn't establish the exact cause.
What I did was close Nautilus before requesting hibernation.
For manual hibernation, I created this small script:
sudo tee /usr/local/bin/macbook-hibernate >/dev/null <<'EOF'
#!/bin/bash
nautilus -q
sleep 2
exec sudo systemctl hibernate
EOF
sudo chmod +x /usr/local/bin/macbook-hibernateI run it as my normal desktop user:
macbook-hibernateAn important detail: don't run this particular command with sudo. Nautilus needs the user's graphical session environment to close cleanly.
After adjusting that, manual hibernation worked, including restoration of the desktop session and Wi-Fi.
Closing Nautilus is a workaround in my configuration, not proof that Nautilus or GVFS is responsible for every hibernation failure.
6. Hibernating automatically when closing the lid
At this point, hibernation was working, but I still had to run a command.
I wanted the laptop to behave like a laptop again: close the lid, put it away, and continue working when I opened it.
I decided to use acpid.
First:
sudo apt install acpidMy /etc/systemd/logind.conf already contained these settings under [Login]:
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignoreI kept them because I didn't want systemd-logind to trigger conventional suspend when closing the lid.
Then I created the ACPI event:
sudo tee /etc/acpi/events/macbook-lid >/dev/null <<'EOF'
event=button/lid.*
action=/usr/local/sbin/macbook-lid-hibernate
EOFAnd the script responsible for handling it:
sudo tee /usr/local/sbin/macbook-lid-hibernate >/dev/null <<'EOF'
#!/bin/bash
# Only act when the lid is closed
grep -qi closed /proc/acpi/button/lid/*/state || exit 0
# Avoid duplicate hibernation requests
exec 9>/run/macbook-lid-hibernate.lock
flock -n 9 || exit 0
# Close Nautilus
pkill -TERM -u 1000 -x nautilus 2>/dev/null || true
sleep 2
# Hibernate
/usr/bin/systemctl hibernate
EOF
sudo chmod +x /usr/local/sbin/macbook-lid-hibernateThe UID 1000 is my desktop user. Anyone adapting this should check their own UID with:
id -uFinally, I enabled and restarted acpid:
sudo systemctl enable --now acpid
sudo systemctl restart acpidThat was it.
Now closing the lid triggers the hibernation procedure automatically.
One thing worth mentioning: my lid-close script uses pkill instead of nautilus -q, because the ACPI script runs outside the graphical session.
7. The result
After all that, I closed the lid and let the MacBook hibernate.
When I opened it again, it powered on and restored my previous GNOME session.
The keyboard worked. The trackpad worked. The display and audio worked. Even the internal Broadcom Wi-Fi came back.
And there's a nice detail about this particular MacBook: it automatically powers on when you open the lid. You don't need to press the power button.
That behavior works with my Debian installation too.
I also did a real overnight test. I finished working, closed the lid, and left the laptop until the following morning.
When I opened it, Debian restored everything as I had left it.
That's exactly what I wanted.
A few final notes
This isn't a fix for conventional Linux suspend. It's a direct hibernation setup that avoids the suspend/resume problems I experienced on this hardware.
I didn't modify applespi, recompile the kernel, or change the Intel LPSS SPI controller.
My internal audio already worked through a separate MacBook-specific CS4208 DKMS driver, which I left untouched.
My final setup uses three main pieces:
- Debian's existing hibernation mechanism and swap resume configuration.
- A systemd sleep hook to handle Broadcom Wi-Fi.
- An ACPI lid-close handler to close Nautilus and request hibernation.
The scripts above reflect what I installed and tested. They are not a polished general-purpose package, and I would strongly recommend reviewing them before using them on another machine.
In particular, make sure your swap configuration is correct, your user ID matches, and your Wi-Fi uses the same driver. Save your work and have a backup before experimenting with hibernation.
If something fails, these commands can help:
sudo cat /var/log/macbook-wifi-hibernate.log
sudo journalctl -b -1 | grep -Ei 'hibernate|freez|failed|brcmfmac'Previous-boot journal history needs to be available for the second command.
Finally, thanks to the author of the MacBook8,1 Debian guide for documenting the original investigation. Reading that work convinced me to revisit a problem I had already given up on.
I used ChatGPT to help interpret the logs and work through the configuration, but the installation and testing were done on my own MacBook.
Hopefully this is useful to other people trying to keep these little 12-inch MacBooks running Linux.
For now, I'm leaving mine exactly as it is. It finally works the way I wanted.
r/linux_on_mac • u/listbox • 10h ago
IT'S ALIVE! Debian Forky/Sid on 2013 Mac Pro 6,1 with Dual Radeon D700
galleryr/linux_on_mac • u/Odd_Bumblebee_3631 • 15h ago
2012 MBP I want to connect my laptop to a TV for watching DVDs what are my best options?
So I have a MBP2012 running lubuntu and want to figure out how I can get it to output to the TV. Should I try and use the mini DP to HDMI with an adapter or would I be better off just grabbing a usb A to HDMI output thingy?
r/linux_on_mac • u/Acceptable_Second_50 • 20h ago
From Toaster to Scalpel Upgrade: My 12-inch MacBook running Debian 13, a few months later
reddit.comr/linux_on_mac • u/OkGrade7585 • 1d ago
Using an old MacBook as a dedicated Linux machine vs getting a ThinkPad – What would you recommend?
reddit.comr/linux_on_mac • u/knightwize • 22h ago
Building a Writerdeck on a 2017 12 inch Macbook air. Yey or Neh ?
Hey everyone. Managed to get my hands on a 12inch Macbook air for my collection. Supposedly from 2017. I was thinking of turning it into a writer deck. A decent debian based distro with a cli interface. On top i'll run stuff like wordgrinder and micro and try if i can get some musicfiles playing via the headphone ports. The ideal no-distraction machine to take to the coffeeshop (with the horrible butterfly keyboard, I know).
I was wondering. What would be a good distro to install ? Are there any track records of hardware support not working or things that need to be adjusted (I have usb-C to ethernet dongle for setup). The machine only needs to be a typewriter that can play mp3 files.
Oh oracle of reddit wisdom and experience .. Speaketh to me!
r/linux_on_mac • u/a70miccc • 18h ago
AirDrop (AWDL) on M1 MacBook Pro 13" - could the new brcmfmac AWDL patches work with the BCM4378?
reddit.comr/linux_on_mac • u/OkGrade7585 • 1d ago
Using an old MacBook as a dedicated Linux machine vs getting a ThinkPad – What would you recommend?
reddit.comr/linux_on_mac • u/skiller969 • 1d ago
Did i make a mistake by installing Ubuntu?
reddit.comr/linux_on_mac • u/RoadRacer5 • 1d ago
Asahi Linux Slight Lag During Videos And Gaming
reddit.comr/linux_on_mac • u/jli2468 • 3d ago
Should have switched to Linux sooner.
my personal mid-2015 mbp with amd gpu was struggling in MacOS. Patched with OCLP to run. But the browser is dropping the gpu acceleration support. Partially switched to Firefox but really still want to stay Chrome. Its a hassle to remember to user firefox to watch video.... then firefox follow suits..... there is a workaround I read, but the signs are on the wall. Finally jumped ship and got linux mint installed.
Man, didn't realize how fast my machine should have been. It took some time to get all the detail fixed. I used the google antigravity agent to fix everything, the key mappings, the gpu driver issue, the suspend/hibernate problem. The AI is a godsend, without it I would be googling for days and looking at logs hopelessly and prayed I didn't mess up something.
Extremely happy with the result. Just wanted to share my experience.
Thank you for the linux devs and google for the AI agent.
r/linux_on_mac • u/Techaissance • 2d ago
Issue With Power States (non-Retina iMac 2015, 16,2)
I have a 2015 iMac with a clean install of Ubuntu 26.04 LTS. Everything is updated. When I click on Power Off, it reboots. When I click on Suspend, it has about a 50/50 chance to either reboot or hang the system. Is there any way to permanently fix this? I'm fine if this involves the terminal.
r/linux_on_mac • u/amano_1234 • 2d ago
Ryoku em um iMac 2011
Olá, sou novo no mundo Linux. Instalei recentemente o Omarchy no meu antigo iMac de 25 polegadas de 2011 — ele está original, exceto por um upgrade para 16 GB de RAM e um SSD. O Omarchy tem funcionado muito bem, mas descobri o Ryoku recentemente. Gostaria de saber se mais alguém tem esse mesmo iMac ou se, dadas as especificações da minha máquina, ele funcionará bem!
Além disso, o Ryoku possui um agente de IA integrado, assim como o Omarchy?
Obrigado pela ajuda!
r/linux_on_mac • u/Character_Infamous • 3d ago
XNU Linux: Full OS X GUI Userspace on Linux
github.comr/linux_on_mac • u/smeg0r • 4d ago
Frigg off BRCM1072
Love love love me my 2017 MBA it’s just the Broadcom drivers.
I am so sick of it I am just rocking a big ass usb to rj45 from my MOCA adapter in my living room. Tres chic!
Now I just gotta wait for the CORRECT adapter to connect my AX200 WiFi card to. Not that waiting 3 weeks for the card wasn’t long enough
r/linux_on_mac • u/TimNotKeller • 4d ago
[SOLVED] MacBook Air internal SD card reader disappears after suspend/resume (Linux Mint)
I have a mid-2013 MacBook Air (MacBookAir6,2 / A1466) running Linux Mint 22.3 MATE and a 128GB SD card in a flush-mounted Nifty Air Silver SD card holder in the SDXC slot so it's always present.
After sleeping and waking, the SD card disappears from the system until a reboot.
The fix was hard to find but easy to implement: cycle the SD reader's power control through the Mac's existing ACPI firmware methods on resume.
Hardware and Software
- MacBook Air 6,2 (mid-2013, A1466)
- Linux Mint 22.3 MATE
- Linux kernel 7.0.0-43-generic
- Internal Apple SD card reader: USB ID
05ac:8406
Finding the cure
The MacBook's ACPI tables contain two methods under:
\_SB.PCI0.XHC1
SPWR— SD reader power controlSRST— SD reader reset control
The MacBook Air J113 (820-00165) board schematic identifies the associated GPIO signals:
- GPIO24 =
SD_RESET_L - GPIO44 =
SD_PWR_EN
The ACPI SPWR method controls GPIO44, the SD reader's power-enable signal.
The arguments are:
SPWR(0)— switch reader power offSPWR(1)— switch reader power on
Step 1: Install ACPI-call
Install the package in Linux Mint:
sudo apt install acpi-call-dkmsLoad the kernel module:
sudo modprobe acpi_callConfirm that the interface exists:
ls -l /proc/acpi/callLoad the module automatically at boot:
echo acpi_call | sudo tee /etc/modules-load.d/acpi_call.confStep 2: Automate recovery after resume
Create a systemd sleep hook to check whether the reader is present after waking. If it's missing, cycle its power. If it's there, skip.
Create the file:
sudo mkdir -p /usr/lib/systemd/system-sleep
sudo nano /usr/lib/systemd/system-sleep/sdreader-recoverPaste:
#!/bin/bash
# Only run after resume
[ "$1" = post ] || exit 0
# Give USB devices time to settle
sleep 2
# If the reader is already present, do nothing
if /usr/bin/lsusb -d 05ac:8406 | grep -q 05ac:8406; then
logger -t sdreader-recover "Reader present; no action needed"
exit 0
fi
logger -t sdreader-recover "Reader missing; cycling SD power"
# Power off
echo '_SB.PCI0.XHC1.SPWR 0' > /proc/acpi/call
sleep 2
# Power on
echo '_SB.PCI0.XHC1.SPWR 1' > /proc/acpi/call
sleep 1
# Record the result
if /usr/bin/lsusb -d 05ac:8406 | grep -q 05ac:8406; then
logger -t sdreader-recover "Reader successfully recovered"
else
logger -t sdreader-recover "Reader recovery failed"
fi
exit 0Make the script executable:
sudo chmod +x /usr/lib/systemd/system-sleep/sdreader-recoverThe result
The internal SD card now returns automatically after suspend/resume.
This is a working fix on my MacBook Air 6,2. It uses the Mac's existing ACPI firmware controls and does not require a kernel patch, a reboot, or a reset of the entire USB controller.
Hardware compatibility
This solution is confirmed on the MacBook Air 6,2. Other Mac models may have different ACPI namespaces, GPIO assignments, or firmware methods. The method names and hardware signals should not be assumed to be identical across models.
Hopefully this saves someone else the hours of troubleshooting it took me to find the solution!
r/linux_on_mac • u/Techie_19 • 5d ago
Mint on MacBook Air
Bought a MacBook Air Early 2015 13” with 256GB SSD, 8GB RAM, Intel i5 1.6GHz for $50 on eBay. Minimal scratching or scuffs. Looks amazing. Battery was only holding about 75% charge so I ordered a new one from Amazon for $28. Getting around 10hrs of battery time.
Decided to go to Mint because Monterey seemed a bit sluggish and temps would get really high. Also replaced the CPU thermal paste. It’s running great for an 11 year old laptop.
r/linux_on_mac • u/knightwize • 5d ago
Debian based Macbook Pro - What are your MUST HAVE apps ?
I bought a 2015 Macbook pro with 16 gigs of ram, a pristine 15" display and a fairly good working battery. What do you suggest as your "MUST HAVE" apps that I should install ?