Mac Mini KVMac16

By Rosie Hattersley. Posted

Self-confessed “hardware hacker” Ivan Kuleshov really likes making things. He’s adept at using tools covering everything from microscopes to lathes, builds and flies drones and has won three separate hackathons. As long as he can remember, he’s been beavering away on various projects related to hardware, from PC modding to the creation of homemade devices, racking up more than nine years on 3D printing and modelling. This aspect briefly became a business venture, but his day job is as a systems engineer in Munich with a string of certifications. His computing, coding and design skills also came in handy for his Mac Mini KVMac16 project, for which the goal was simple: to provide full access to a Mac mini in a remote data centre, with a bit of help from Raspberry Pi 4.

The right tools

Ivan values Raspberry P’s modularity which allows him to create unique devices and has previously used various models including Compute Module 4 in his Compute Blade, an energy-efficient alternative to a rack-mounted server. He praises the “relatively cheap minicomputer with a huge community, which greatly lowers the threshold of entry and increases trust”.

For the Mac Mini KVMac16 project – Ivan describes it as “a console for 16 Mac minis on a shelf that occupies a 6U space in a server rack” – Raspberry Pi is used as a KVM (kernel-based virtual machine) while “the PiKVM HAT is used for video capture and keyboard/mouse command transfer”. Ivan chose Raspberry Pi because it both supports the components and offers long-term software support. He says: “Raspberry Pi 4 with 4GB is easily sufficient for the task”.

KVMac16 helps get an offline Mac mini back up and running should an update or other issue cause it to be out of action

As Ivan’s blog explains, should a Mac go down due to a failed update or any another reason, the only way to reboot it is to physically press its power button. This is not something that can be done remotely, and is the issue his KVMac device addresses. “To provide full control, with the ability to completely reinstall the OS, you need to press the power button and there are no other options.” Ivan has created the optimal workaround: a Servo HAT and self-written Python scripts control the servos used to physically push buttons on the Mac mini. He also uses RS232 to control a regular KVM switch from the user interface between a Raspberry Pi PiKVM HAT and 16 Mac minis, through which he can connect to any of them.

Third time’s a dream

As Ivan details on his Uplab blog, creating the KVM Mac Mini project involved three different versions, with improvements each time focusing on ease of installation and overall reliability. PiKVM is at the heart of the project, and provides a basic user interface, “but the ability to physically push buttons, and the 16 Mac mini install stand itself, are designed by me from scratch [as were the] custom scripts and UI modifications to give the user full control”.

Ivan’s “perfect shelf’ for his Mac mini project allows air to circulate while being very robust

Many of the challenges were because the project uses servos and levers to push buttons on the Mac minis, which need to work with maximum reliability. He started the project from scratch three times and counsels other would-be makers that if you find your project moving in the wrong direction, stop, reappraise and “have the strength to start over from scratch”. Ivan did this twice here, and says it strengthened his project as well as validating the potential for both a four-Mac mini model and a potential CI/CD one (Continuous Integration Continuous Deployment).

It is just as well that Raspberry Pi proved a good option. Ivan says there are “simply no alternatives. This project was only possible thanks to Raspberry Pi and PiKVM.

From The MagPi store


Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.