Home Assistant in Mac M1

you can run docker in docker :slight_smile:

I will stick to the vm solution but maybe somebody should release a VM version of HA compatible with ARM64 or even to be able to install supervisor as a OSX package in the same way it is installed in debian

Ahh, I see you can.

I don’t see the HA team developing an ARM64 version quick, their focus is Debian. Now if RaspberryPi went to ARM64, then it might happen. Even though I think it runs a 64bit os in arm, so I don’t really know the difference - well I do, but don’t know how different the arm chips are.

I imagine you can try to use the Linux install script, which will I’m sure try to install supervisor into you docker instance, but I’d expect a boat load of mess, and I try to keep my base os clean. Much easier to wipe and rebuild a vm, or snapshot and try things. If MacOS goes wrong, then it has all gone. Had to rebuild a month or so ago, to recover 300GB it had consumed somewhere - rebuild was under advice or senior Apple resource…

Thanks! It was an useful conversation :wink:

New to HomeAssistant and only know enough to be dangerous. I have tried using UTM which creates virtual X86. Seem so install ok but QEMU guest doesn’t start. Home assistant start with ha prompt but no IP displayed to access and 8123 doesn’t work either

Not sure what UTM is? I plan to give it another go over the coming weeks, so will give some details here.

Had a look at what UTM is and see it uses QEMU under the hood. I would assume you should be able to emulate an AMD64 or an ARM7 machine, install Debian and then just run the supervisor install script. I might give it a go…

I’ve just gone through and installed HA Supervised on Debian on Parallels on Mac M1 Mini. The basics of this are:

Waited a little while and Home Assistant was available on port 8123 at the servers IP (which can be found using ‘ip addr’ or look up on your router). This is the set of containers created. I see the homeassistant container is qemuarm-64 whilst all others are aarch64, which all looks fine.

I’ve not tested it any further than that apart from to add SSH/Terminal and File Editor, but it seems to run natively on Debian.

I’m hoping I can migrate my whole environment across to the M1, it has gone a lot better than I had hoped.

6 Likes

@RogTP thank you for writing up this step by step summary! If you do not mind sharing any other tips/tricks or shortcomings that you find, I would appreciate it! I plan to do this migration to M1 in about a month.

I need to have a day or so clear to try a shift, last time I moved there were some hiccups along the way. However this time I don’t have any non HA containers on the VM, so hopefully it should be good.

I’ve installed all the addons onto the server to make sure they are all available as aarch64, I’ll do a trial startup of each of them prior to missing. I know I have a very big apache addon using stuff from the share folder which was a pain, but I may dump that anyway.

Any questions about getting basic setup going, just give me a shout.

You could just run directly on macOS in a Python virtualenv.

Are you able to run approx 10 docker containers in a python venv? I’ve not tried anything like that, seems strange, but then I wasn’t aware you could run docker on docker…

HA Core runs in a virtual env without Docker. You could still run your other containers in Docker.

Thanks, I’m trying to run HA Supervised so I have a single management interface. I can then also use whole VM snapshots for instant restore around major upgrades if needed.

On a separate point I have noted that I am getting occasional reboots of the M1 box. I essentially run it headless running Plex and HA (and some other bits and pieces), but starting it up using an HDMI connection. I see people complaining of HDMI causing problems on the M1, so I’ve ordered a USB-C to DisplayPort cable, which I’m hoping will solve the problem. I need the server to run stable before I migrate.

FWIW, I’m running HA inside a VM using Oracle Virtualbox on a 2018 Mac mini and it is excellent.

With 4 cores and 4Gb assigned to the VM is really quick and the clone option is a really nice safety net.

From a performance standpoint, it knocks the Rpi with SSD into a cocked hat.

It’s a very easy install too.

This guide is very useful for having the VM auto-restart after a power off.

Agreed. I currently run on a 2013 Mini, I forget the vm spec, but it is using Virtualbox. The M1 is using Parallels because when I set it up virtualbox didn’t support M1 (not sure if it does now). I did originally use an RPi, but it was just too slow. That said I do use one for a very small setup I have at a remote location, which links back to my main one. Also use a small pi for monitoring a ups using nut.

Hi @RogTP I just wanted to say what a fantastic guide, I was able to follow this step by step and got my HA migrated from an old Raspberry PI 3 to my Mac mini M1 absolutely perfectly. After following your steps on Parallels 17, being the cheap skate that I am, tried it a 2nd time on UTM and again, worked absolutely no problem. Only downside to UTM over Parallels is lack of automatic starting of the VM on boot (which I don’t do often anyway as the Mac stays on 24/7), and also needing to reconnect my USB Z-Wave and Zigbee sticks on boot every time also, other than that its spot on as far as I can tell. Thanks very much!

2 Likes

Good to know that they work. I’ve a z-wave stick, but haven’t tried it yet. Been a bit busy, and going away for two weeks, so should get to the migration in mid-december.

@RogTP @tcork: Thanks for the Mac M1 HA trail breaking, your posts kept me at it. I’ve managed to get HA running well on a new M1 Mac-Mini with the bare bones debian-11.1.0-arm64-netinst.iso install on UTM (I guess I’m cheap too) I have usb working with a Nortek HUSBZB-1 Wave/Zigbee radio stick and HA sees it no problem.

Next on My List:
(1)I really want to get the VM to boot in case of a power loss and the Mac restarting
(2) I want the VM to connect to the USB ZWAVE/ZIGBEE stick.

Just wondering if anybody was able to figure out how to do this with UTM, especially item 2)

1 Like

Good guide. I was able to get Home Assistant Supervised working on a Mac Mini M1. I’m coming from an Unraid installation. Everything went pretty smoothly.

I have an Aeotec Z-Stick Gen 5 passed through to the Debian VM. It mostly works, but I have had issues where statuses don’t update consistently. I’m not sure if it’s a zwavejs2mqtt issue, Z-Wave network issue, or a VM issue. When enabling the debug in zwavejs2mqtt, nothing shows up in the log when the issue occurs.

As far as performance goes… again, I’m coming from an Unraid setup that had 64GB DDR4 ECC, Intel Xeon 6238T CPU, and the dockers ran from a Samsung 980 Pro… the M1 is stupid fast for Home Assistant. I was having database slowness with the Unraid build that has magically gone away with the M1. Best thing with the change is my power consumption went from around 200W down to 6W and the room where it was running is significantly cooler and quieter.

I still haven’t migrated my production install to the M1 yet, it’s still running on a nearly 10 year old mini. I did do a trial run of the Aeotec Z-Stick Get 5 on the M1, and it didn’t seem to connect to it every time, not quite sure why. But it did start up after a couple of trials, so I’m planning to migrate next week. If I can get it stable and reasonably reliable to start (given I basically only restart that container when there is an update), then I’ll stick with it. Alternatively I can always put the zwavejs2mqtt onto a Pi, so I can decommission the old mini.

I will of course post back here, and I’ll comment on whether the ZWave reports reliably.