I have Ubuntu 10.04.1 (Lucid) running on a 2010 Mac Mini (4,1). It's a server, so I want it to be able to restart after a power failure ("server mode").

In Mac OS X, you can check "Start up automatically after a power failure" in the "Energy Saver" System Preferences. However, having this value checked doesn't seem to effect "server mode" behavior in Ubuntu (that is, it won't restart after a power failure).

This seems to be because the "server mode" value isn't persisted in pram/efi, but gets set by Mac OS X on every boot.

I found this tutorial on how to turn on "server mode" for a Mac Mini, but it doesn't work:

$ setpci -s 0:1f.0 0xa4.b=0
setpci: Warning: No devices selected for `0xa4.b=

A lot has changed with the new 4,1 Mac Minis-- just getting Ubuntu installed on it was quite a feat. Perhaps the "server mode" incantation has changed also?

My question is: how do I enable "server mode" on the new 4,1 Mac Minis?

  • 1
    In my experience, this is something typically handled by the bios. Since I know nothing about the lower workings of a Mac (other than that they use mostly standard Intel processors), I wouldn't be able to tell you how set the necessary values in the bios, let alone how to get into it in the first place. – MBraedley Nov 18 '10 at 22:35
  • You mean EFI, not BIOS. Anyway there's no EFI setting for this. It's a chipset register that has to be poked on every bootup. I wish it were in the EFI, or in the pram at least, then we'd only have to set it one time! – paleozogt Nov 18 '10 at 23:42
  • My point exactly. – MBraedley Nov 19 '10 at 2:59
  • The current solution does not work for Mac Pro, but you can check this bug at Ubuntu bugs.launchpad.net/ubuntu/+source/linux/+bug/784571 – sorin May 18 '11 at 13:00
  • @Sorin Sbarnea: well, the question is for a mac mini – paleozogt May 18 '11 at 14:54

On some Mac Minis (I tested on one circa 2014) it still seems to be:

sudo setpci -s 00:1f.0 0xa4.b=0

I verified this after some research. The steps I took to find out, which theoretically can be done for future iterations of these machines too, were:

  1. Look for the LPC device:

    $ lspci | grep LPC
    00:1f.0 ISA bridge: Intel Corporation HM77 Express Chipset LPC Controller (rev 04)

    In this case, it's 00:1f.0.

  2. Find a datasheet for the device. E.g. Googling for "intel hm77 lpc controller datasheet" yielded this datasheet.

  3. Now you just have to find the right register, which could be a challenge depending on the data sheet. Here I found " Sx-G3-Sx, Handling Power Failures, p. 180" in the table of contents, which describes the control bit AFTERG3_EN.

  4. Searching through the document for that, we find it in section (general PM config register 3) at the bottom of the table on page 530. From this we see it is bit 0 of the 16-bit register at 0xA4.

Then that can be used to construct the relevant setpci command.

So if this changes again in the future, find the device, find the datasheet, construct the command, test, and raise your fist in victory.

But basically the device and register address may differ on different machines, it's specific to the LPC controller; so that's the piece of hardware you have to check first before determining which command to use.

  • this works on an old iMac of 2007! the controller is a different one, but checking the relevant docs lead to the same command, in the end... – benzkji Nov 22 '18 at 14:13
  • it is true that this must be executed on every boot, otherwise it's lost... – benzkji Nov 22 '18 at 14:20

I found the answered buried in this post. The new setpci command is

sudo setpci -s 00:03.0 0x7b.b=19

btw, this setting isn't "sticky" and won't persist across reboots-- it has to be set upon each boot.

You can put this command in a bash script and run it on startup. See here for details on start-up scripts.

  • Can you run that command in a start-up script, or will it still ask you for the su password? – MBraedley Nov 19 '10 at 3:01
  • Yes you can run it in a start-up script. I've edited the answer to link to a start-up script how-to. – paleozogt Nov 19 '10 at 16:03
  • Could you be so nice to add information regarding where to add this line in order to assure that it will be executed when the system boots, preferably as soon as possible? - Ubuntu – sorin May 18 '11 at 11:32
  • @Sorin Sbarnea: in the answer is a link to info on start-up scripts in ubuntu – paleozogt May 18 '11 at 15:00

I can confirm on a Mac Mini (late 2012) adding this to the root cron:

@reboot /usr/bin/setpci -s 00:1f.0 0xa4.b=0

will make it reboot on power failure.

  • You can confirm that your suggestion works on a Mac mini or you cannot confirm it works? – Ramhound Apr 23 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.