I spent my Christmas vacation working on a project. A friend donated their old Intel Mac Pro (the big sturdy ones from around 2008-2010?) and I want to use it to run a Yunohost server at home. I already have a Yunohost server on a Raspberry Pi so I thought this would be easy. I was wrong! But many hours later, I got it working. So I want to report back on how I did it. I also have some questions for y’all.
Following all this, I intend to help improve the yunohost documentation based on my experience.
My YunoHost server
- Hardware: Old Intel Mac Pro tower (from 2008-2010?), at home
- YunoHost version: x.x.x (latest at the time of writing)
Overview
A summary of what the steps are:
- Attempting to install Yunohost (which will probably fail)
- Installing Debian 11
- Installing Refind to be able to boot Debian
- Installing Yunohost on top of Debian 11
Before you start
You’ll need:
- A Mac Pro with an Intel CPU
- Good knowledge of Linux. This isn’t a beginner project. Apple makes it difficult, but not impossible, to run Linux and Yunohost.
- An empty drive to install Yunohost on. (It’ll be easier and less error prone if you format it before you start installing Yunohost)
- If you have other drives with other OS (ex: Mac OS), I recommend unplugging them during the install. This will reduce the risk of mistakes. Of course, if you really know what your doing or if you want to use an existing EFI boot partition then you can keep 'em plugged.
- A wired keyboard
- A wired internet connection will make your life easier
- Another computer or device to read these instructions and search online in case of problem.
Known limitations
Why it’s a bad idea to use a Mac Pro as a server:
- As far as I know, Mac Pro running Linux cannot automatically power on after a power failure. That feature only work if you boot MacOS.
- I’ve been told that Mac Pros consume a lot of electricity. You might want to verify that before leaving one running 24/7 (unless you live in a cold country where you can use it as a heater!)
Choosing which image to download
Choose the 64bit image. As far as I know, there are no Mac Pro running 32 bits processors.
Booting the image
I couldn’t get the image to boot after flashing it to a USB stick using Etcher. So I used Ventoy. Ventoy is a nice tool that makes it really easy to put multiple linux images on a USB stick. When the computer refuses to boot from an image on a usb stick, Ventoy will usually be able to boot it anyway!
- Install Ventoy on the USB stick. This will create 2 partitions on the stick.
- Copy the Yunohost image file on the big partition using your file explorer/Finder (don’t use Balena Etcher for this!)
- Reboot, holding the Alt key on your keyboard until you see the boot menu (use a wired keyboard). Select the Ventoy usb stick to boot it.
- In Ventoy, select the Yunohost image
- Select GRUB2 launch option (the default didn’t work for me). If that doesn’t work, try the other ones?
Installing Yunohost / Boot partition (part 1)
At this point, if you manage to launch the Yunohost installer, install it and boot Yunohost successfully, you can end here.
Unfortunately for me, the install failed when creating the EFI Boot Partition. To troubleshoot, I tried to install other distributions of Linux. Only Ubuntu could install. (Fedora, Pop OS, Debian all failed when trying to install the Boot Partition.) The logs showed a lot of “EFI variables are not supported on this system.”
From what I could understand, this is because the Mac Pro doesn’t expose its EFI variables (or doesn’t use them?), so GRUB fails to install. There’s a way to install GRUB using the --removable flag (grub-install --removable
) but it didn’t work for me. (You can try it and report back here about your attemps.)
My solution so far was to install Debian 11 and use the option to wipe the whole disk. This of course deleted MacOS and all data on the disk, so be careful if you don’t want that.
Installing Debian
I used the Debian 11 net-install, 64bits. There is a “Mac” version but it didn’t boot for me so I used the regular one. Do not install Debian 12, because Yunohost doesn’t support it at the time of writing.
Again, I had to use Ventoy to put it on the USB stick and be able to boot. Just copy the file using your file manager / Finder (not Balena Etcher). In Ventoy, select Debian and then select the “GRUB2” launch option.
Debian installer will ask for a hostname and a domain name. I used “debian” and “debian.local”. It’s not important since the Yunohost Installer will replace those.
Debian will ask for a root password. Make sure you pick a really long and complex one and save it to your password manager of choice (Bitwarden, Firefox, etc…) or write it somewhere safe. Remember that this is a server that will be available on the internet, making it vulnerable to possible attacks so you should be extra safe here!
The installer will also ask for a user account and another password. Important: name it something that won’t be used by your Yunohost server. I used debian
and another long complex password.
The installer might complain about “legacy BIOS compatibility mode”. I selected Yes to force UEFI installation, because all Macs with Intel CPU are known to use UEFI.
When the install asks about where to install and how to create disk partitions, select the option to use the whole disk.
- As I wrote earlier, you should have formatted the whole disk before starting the install. If you didn’t, do this now. It’ll avoid problems. (Unless you know what you’re doing and you want to use an existing EFI partition)
- Don’t separate the /home, /var or /tmp partitions. Use the option to “keep all files in one partition”.
- Make sure the EFI partition is formatted as FAT (or
vfat
). In my case it was the default. - Don’t encrypt any partitions, as recommended by YNH)
The installer will ask about mirrors. I used the default options.
The installer will ask about which desktop environment you want. You should not install a desktop environment on a server so unselect them all. Keep only “standard system utilities”.
The Debian installer will complain that it couldn’t install GRUB. We’ll fix that later with Refind so select Continue without bootloader, then Finish installation.
It might complain again about the missing GRUB bootloader. If it does, just select Abort installation. We’ll fix it in the next step.
Installing rEFInd
If Debian installed successfully without complaining about GRUB or the bootloader, and you can launch it properly, you can skip this step.
At this point, Debian is installed, but cannot boot because GRUB fails to install, again because it can’t access EFI variables. There’s a way to install it anyway, using a live-usb stick and the grub-install --removable
command, if you really want to, but in my experience, GRUB is buggy on a Mac Pro: the screen stays black when GRUB runs, so you can’t see what you’re selecting. So instead, I installed “rEFInd”.
Refind is a EFI boot manager similar to GRUB or the default Apple one (that appear when you boot your Mac holding the Alt key).
To install Refind:
- Boot the Mac Pro using either an existing macOS partition or a Linux live-USB stick (I used Ubuntu)
- The live-usb will ask if you want to install Ubuntu. Decline using the “try Linux” option.
- Open Firefox, go to the Refind website
- Download the binary zip file (Don’t use the debian/deb/rpm packages because they try to automate installing and that won’t work.)
- Extract the zip
- Open a terminal, and unmount ventoy:
umount /boot/efi
(it might be already unmounted) - Mount your EFI partition
sudo mount /dev/sdXY /boot/efi
(replace X and Y with the letter and number of your actual partition. You can use the Disks app to get this information. In my case it was “sda1” so my command wassudo mount /dev/sda1 /boot/efi
. Be careful about this!) - Navigate to the refind-1.2.3 folder and run
sudo ./refind-install --usedefault /dev/sdXY
again, replacing X and Y with the ones of your actual partition - If you don’t see any big “Alert!” you should be good. If not:
- It might complain about missing “sgdisk”. Install it by entering
sudo apt install gdisk
then try installing refind again. - The installer might suggest to copy/rename a file into another directory. Try that maybe?
- If you see some alerts about EFI variables, go read the Refind documentation about
--usedefault
and try those? - If it looks like the installer cannot find your EFI partition and tries to install into your Ventoy USB key, it’s probably because your EFI partition isn’t formatted as FAT/VFAT. Reinstall Debian following my instructions above.
- It might complain about missing “sgdisk”. Install it by entering
- Reboot your Mac (unplug your USB stick with the installer first )
At this point, you should see Refind when you reboot your computer, and you should see Debian in the list of options. Select it using the keyboard and press Enter.
Installing Yunohost (finally!!)
Finally, Debian is running! You should see a login prompt.
Login using root
and the root/admin password you created earlier. Don’t use the user account, as recommended in the Yunohost documentation.
At this point, you can refer to the official Yunohost instructions: Installer YunoHost | Yunohost Documentation
- type:
curl https://install.yunohost.org | bash
- It will proceed to installing Yunohost. If it works, you can now continue using the regular YNH installation instructions.
- It might ask about overwriting some configuration files. I selected Yes.
- If you see an error about missing command
curl
, the official YNH instructions has more guidance for you.
That’s it! Congratulation!
Possible future improvement of this guide
- There’s probably a way to install Refind without using a Ubuntu live-usb stick, either before installing Debian or during the install using a shell, but I didn’t try it yet.
- How to make refind boot faster (change the default 20 sec wait period)
- How to make the Mac reboot after a power failure
- A note about power consumption
- Using
btrfs
with rEFInd is tricky but possible
Questions for you all:
- What’s the recommended format for the Yunohost partition? I used ext4. Would it be easier/better to use btrfs instead?
- If Yunohost is installed on an SSD, which mount options are recommended? noatime and nodiratime? Anything else?
- Which options should we use when installing Debian?
Should we be careful not to use a username that will later be a yunohost account? For example, if I use “narf”, will I be able to have a “narf” account on Yunohost?- It asks for a root password. Will this be the same as the admin account password?
Which Desktop Environment should I choose?
If I installed a DE, should I get rid of it after installing YNH? How would I do that?