Wednesday, December 23, 2020

Arch GNU/Linux and OpenBSD on mac mini 2018, 2019, 2020(Intel processors)

     The laptop is not an ideal computer when you are sitting at the same desk and especially when you are at home. At home, the best computer would be a desktop. For the past 5 - 10 years I have been using laptop at home, but desktops at work. I observed that I have been killing the battery. I have my laptop always connected to the power supply and that is not good. Draining your battery just because you should drain it, though you are near to a power supply is not something which I can digest. For nearly an year used the raspberry pi 4 as a desktop and tried the frugal method of using a computer. I have been mighty happy with the direction the raspberry pi is headed. I loved what the rpi foundation is doing. It is the apple philosophy of making the hardware and software together but with freedom software ethics in place. Yes, there are still blobs being used, but the foundation is putting enough efforts to tend towards an open ecosystem of software and hardware. 

     Now, the thing with the rpi ecosystem is that you have to be abreast of the developments. If you use the bleeding edge software, you should be ready for the occasional glitches. Now, this is a problem, if you want to just start the computer and do an immediate task. Yes, if you run the debian stable, ie, the official rpi os, you are better off. But, the software is outdated for somebody who has been spoilt for using arch Gnu/Linux or Debian testing. Yes there are plenty other options for Operating systems. But, they all have something lacking. I have tried one and all. I have tried the ubuntu dev version, which I used for a long time. But, it was borked many a times during a upgrade. So, it is back to reading the forums and clearing up stuff. Plenty of experiments were carried out. I live a couple of months on the command line "only". It was very interesting and I liked the challenges that were presented. After an year, something happened and the pi 4 started acting strange. It was time to move on. The first rpi 4 had a damaged sd card slot before the usb booting came out. So, as for now, the rpi efforts are shelved.

    As is the norm for a lull after the storm, I decided to take it a little easy this time and decided to have a cheap desktop solution for my daily use at home and keep the laptop for mobile purposes. Started searching the used computer market for a sleek desktop. Plenty of Intel nuc's came along. Every single model has a lacuna on some issues. Marketing and the modelling of these systems is a total failure by Intel. The number of variants is mind boggling and utterly confusing. Searched for mini pcs from other brands like HP and Dell. Nothing interesting came up. This is the time, Apple came out with its M1 processor. I was surprised that Apple released a Mac Mini with its inhouse processor. Started knowing about the Mac mini and at the same time started looking up the used pc market. There was no way, I would be buying any device from Apple on which I cannot install GNU/Linux. I have a mac book pro 2015 which runs Arch Gnu/Linux and OpenBSD like a dream. In summary, I like apple hardware and hate their software and the lockups they try to force people to stay on macos. Until, I can install Gnu/Linux or BSDs, I dont have any gripe with apple. I love the way they make their hardware. If customization is allowed, the choices are easily laid out and of course can be very very very costly.

    Since Gnu/Linux on a mac mini M1 is still a very looooong shot, I started looking at the older versions. I liked the form factor of the mac mini. There was one more surprise, the extensibility of the mac minis. This was a complete shocker. Four thunderbolt 3 ports, two usb 3 ports, Gigabit ethernet ports, 3.5mm jack. It is like the voltage of the shocks went on increasing. Settled to buy a mac mini 2018. Waited and searched for a month and I got my hand on a "very" affordable mac mini. The build quality is excellent. The option of upgrading ram upto 64GB of DDR4 was un-believable. Postponed the upgrade for a later date. Already had a 32" LG 4k monitor, a mechanical keyboard and a M501 logitech mouse. Had an external ssd which I was using to boot up the raspberry pi. Everything just fell in place. The onboard storage is only 128GB. But I am OK with it.

    Searched the public network for installing Gnu/Linux on a mac mini. The literature is very limited. But, could put together a collection of information necessary. Infact, the installation of Gnu/Linux or a BSD on a mac mini is much simpler than that of installing windows through Bootcamp, which was a breeze when I bought the macbook pro 2015. Installation of Gnu/Linux or BSD is mighty straight forward and can be summed up as

1. Disable the secure boot and file system protection(csrutil disable) on the mac mini


2. Partition the external ssd hard drive(Dont forget to create a FAT32 partition with type set to EFI as the first partition on the external SSD, a 512MB partition will do) for Gnu/Linux and OpenBSD(I prefer OpenBSD to Freebsd just for the fact that the graphics stack is "owned" by the core devs of the project and all other security related "firsts". Again a "sensible" default) 


3. If you want to install OpenBSD do not forget to create a partition of type OpenBSD before starting the installation on any other GNU/Linux box. This will provide you and option during installation to chose that particular partition. This just makes the job easy for installing OpenBSD in multiple boot machines.


4. Download and install the refind boot manager from macos(You can install this in the macos recovery which you have entered to disable the file system protection). I just love this application. My gratitude to all the devs and users of this excellent tool.


5. Install Arch Gnu/Linux. I chose to install arco Gnu/Linux for a change and I loved the installer. Be wary of choosing other software options provided during the setup process. It struggled to download and install these. It is better to install these extra options doled out to you after the base arco install. The installation was flawless. Again dont forget to choose the EFI partition created in step two and set the boot flag. This option will be thrown to you when you select the EFI partition to be mounted as /boot/efi


6. Install OpenBSD. I love the installer. I have expressed my awe at the defaults the installer puts up. Installation process was flawless. It trumped the arco install process. Kudos to the OpenBSD team. Here again, OpenBSD expects an EFI partition on the first partition of the external SSD, which we have already met.
7. Wifi and sound through the 3.5mm jack does not work. This is the same for Arco Gnu/Linux and OpenBSD.


8. Resolved Wifi by using an USB adapter and resolved the sound issued by taking the output from my monitor.


9. At some occasions, refind is unable to boot up macos. The work around as of now is to shutdown the mini and restart. At the chime press the alt key. This will bring up the apple boot loader. If you are lucky you will see the options for choosing the apple drive and the EFI partition on the external ssd. If you are unlucky, you will definitely get to boot the macos partition. To boot the FLOSS operating systems, just reboot and you will be presented with the refind menu.


10. Dont forget to enable the file system protection again by entering the recovery menu(csrutil enable).


11. Arch Gnu/Linux and OpenBSD run flawlessly and the availability of 4 thunderbolt 3 ports is freaking amazing.


12. The form factor is just perfect for putting it in a compartment in my table without clogging the surface of the table for space. Resulting in one of the neatest desks I have maintained.


PS: All of a sudden, my arch gnu/linux installation was not detecting the Ethernet connection. Ran 

lspci

After searching the public network for the Ethernet hardware detected, tried

# modprobe tg3

reboot, and Ethernet started working.

2 comments:

  1. Hello,

    thanks for this article, I also made an attempt with a Mac Mini 2018 some time ago to run Manjaro Linux on it. But in my installation there were problems with suspend and resume, the system could not be restarted after suspend, did you have similar problems and could you solve them?

    Greetings, PDI

    ReplyDelete
  2. Hi,

    Thanks for the appreciation. I dont like the suspend/resume functionality. In all my computing years, I have never used them. I switch "off" my computers. Let them be desktop or laptops. My devices are always ON or OFF. Sleep works beautifully after a certain amount of time. Display and hard disks both sleep well! and wake up when commanded.

    Apologies for not being much of a help.

    ReplyDelete

Nobody can deter me away from "free as in freedom" concept seeded by Sri RMS. See to it that u dont make fun of my belief. If u think otherwise, no need to comment.