Home Assistant in Mac M1

Hi all!

I have some tutorials that may be of interest, relating to the discussion in this thread :slightly_smiling_face:

How To Run Home Assistant Supervised On Mac OS (For M1 Macs) - This is a complete guide to setting up Home Assistant supervised using UTM on a Mac M1.

For those of you who were reluctant to use UTM due to it not having an option to start on booting Mac OS, it is actually rather simple to get UTM to launch the Home Assistant VM on boot, there is a section that explains how to do this in the aforementioned article.

If anyone is looking to run Home Assistant Core natively on Mac OS using venv, I covered it in one of my older tutorials that you can check out here and can confirm it works on M1 Mac. However in almost all cases I would recommend the UTM approach, as running Core without supervisor will be lacking some features, such as the add-ons store.

Questions or comments on any of those articles is of course welcome, and thanks guys for the earlier posts, some valuable information in this thread! :slightly_smiling_face:

5 Likes

This is great! Followed your guide and installed Home Assistant on my M1 mac in 20 minutes!

Thanks a lot!

For UTM on M1 with the full HA OS.

Download UTM from: https://mac.getutm.app/

Download HaOS from www.home-assistant.io/installation/macos

Then double-click it to extract the files to use the ā€˜haos_ova-8.5.qcow2ā€™ image inside.

  • Open UTM and create a new VM using EMULATE > Other
  • For Boot ISO Image, choose: ā€˜Skip ISO Bootā€™
  • Architecture: x86_64
  • System: Default (q35) Standard PC
  • Memory: 2048 MB
  • Cores: 1
  • Storage: 32 GB (use more if you want but not sure if this has any effect on the image)
  • Shared directory: none

Right-click the new VM and ā€˜Editā€™

  • Network > Network mode: select ā€˜Bridged (Advanced)ā€™
  • New Drive > IDE > Import: select the ā€˜haos_ova-8.5.qcow2ā€™ image file previously extracted
  • Save
  • Start the VM

Viola, you have a fully functional HassOS that will start up and configure itself.

Note, it will restart a few times while setting itself up and once running and you connect to the http:// address, it will take a long time to ā€œPrepareā€ itself. It says up to 20 mins but I think mine took longer.

Iā€™ve been running this for over a month now and it has taken itself through a number of HA version upgrades and one OS upgrade.

The one thing Iā€™ve noticed lacking is Bluetooth from the Macā€™s motherboard. However, I suspect a USB bluetooth dongle would work with the UTM USB passthrough.

8 Likes

Instead of emulating, which is slow, what you want to do is use Virtualize and download the latest aarch64 image from Releases Ā· home-assistant/operating-system Ā· GitHub .

The rest of the steps are the same, except:

  • Deleted the drive created during creation/setup
  • Used Virtual disk (default option) instead of IDE when importing the downloaded image
  • Resized the qcow2 image after importing it to 64gb
6 Likes

Absolutely brilliant @JurajNyiri. I had searched but had not found an ARM build workable on UTM, but it was there all along and works blazingly fast. I did a backup and restore and now have it running on a native ARM VM.

One question though, how did you do the resize of the qcow2 image to 64GB? After all the steps, my image is sitting at 5.2GB. My previous install ended up with a 15GB disk image, but 64GB would be much better.

Method to resize found here. This worked for me although I wasnā€™t too happy modifying my MacOS with HomeBrew. Should be fairly harmless though.

Also a nicely documented full install of HassOS on M1 Mac is here:

Amazing guide but the only part is I canā€™t load the UI. I try to enter the urls provided once the VM loads successfully, but none of them resolve. Anyone know what my issue might be? (I followed the guide to a T).

Edit: I found other tutorials and the error Iā€™m seeing is due to IP not being assigned. ā€œYour Network is probably not using the DHCP protocolā€? My router definitely uses DHCP. Iā€™m using wireless and havenā€™t tried wired yet. I tried assigning a static IP using the MAC address but still nothing.

I wrote a script which automates mounting/passing USB devices in UTM on Mac.

3 Likes

Did you get this going?
It sounds like a cause could be the network is not bridged to the correct Mac interface. Usually this is en0, but depending on your Macā€™s network connection this could be something else.

In terminal type ā€˜ifconfigā€™. This will list the interfaces on your Mac. Find the one containing inet xxx.xxx.xxx.xxx where xx is your Macā€™s LAN IP address.

Then in UTM go to the ā€œNetworkā€ page, select ā€œBridged (Advanced)ā€, in the ā€œBridged interfaceā€ input field, enter the interface you found above.

Restart the VM and note the IPv4 address on the VM screen as below. It should be the same subnet as your Mac. Use that IP address in your browser with :8123 on the end.

1 Like

This totally kick arse @HJM @JurajNyiri , I have using my Synology NAs which is so slow, and then UTM on the mac mini (using emulation), still slow! Then found this guide, startup went from at least 3-5 mins to under 30 seconds! Just Awesome!

Any idea how to get copy paste working? I noted that in the startup logs I get

[FAILED] Failed to start QEMU Guest Agent.
See ā€˜systemctI status gemu-guest.serviceā€™ for details.

I could just SSH it and get copy-paste working, but when troubleshooting on the VM, itā€™s just nice to have.

Note I had the same issue using UTM when using emulation.

Has anyone managed to get one of these HASSOS images booting on Parallels?

Iā€™ve got it up and running on UTM at the moment, but UTM seems to keep disconnecting my USB BT dongle. Would like to try it out with Parallels.

In terms of performance, is UTM heavier on the machine compared to a container in docker?

Looking to ditch the rPi4 and move it all to a mac mini m2 and wondering if worth the trade off.

That decision is more based on what you want to achieve, a whole vm in UTM or Parallels will allow you to run HassOS or Supervisor, a docker container will be a single item, so will be only Core.

A VM (which will then run docker inside it) will use more resource than a single container.

I did, thanks. Funny enough, I ran into a different problem when I replaced my routers. Apparently Tp-Link Decos donā€™t work with virtual machines unless you hard wire them. Otherwise, it could appear in the app which prevents you from port forwarding properly.

Hello, Iā€™ve gotten HA running on Mac Mini M1 using UMT by restoring from a rp4 backup. For the life of me I canā€™t seem to figure out how to get the Aeotec Z-Wave stick to be seen. Iā€™ve selected the right USB option on the running virtual machine (when I plug in the Aeotec stick it prompts me new USB device detecte, Iā€™m using an USB hub since the Aeotec stick is too bulkly and lack of USB ports on the Mac Mini). Could it be the backup of the rp4 causing this issue and I just need to restart from scratch, (would like to retain what I already have running on rp4) though if possible. The reason Iā€™m moving over to Mac Mini M1 is because HA on rp4 keeps stalling after few days of operation and I have to restart rp4 to get it back to operating. If someone knows how to prevent the stalling issue on rp4 please advise, Iā€™m thinking its mostly related to the SD card from my online search for this issue. HA does seem to run much more quicker on the Mac using UTM compared to the rp4. Thanks in advance!

Are you using Debian on UTM or HASS OS? How are you validating that the USB isnā€™t being seen in the VM? I use Parallels personally which shows me if it thinks the Aeotec is connected to the VM, then in Z-Wave JS UI it shows on this serial port - /dev/serial/by-id/usb-0658_0200-if00 - which I can validate by checking for it in Terminal/SSH.

Iā€™m using Debian on UTM, when going over to the left sidebar of HA and clicking on Z-Wave JS Iā€™m seeing this in red background ā€œDriver: Failed to open the serial port: Error: No such file or directory, cannot open /devā€. Also on the Z-Wave JS intergration Iā€™m getting ā€œRetrying setup: Noneā€. Sorry Iā€™m novice when it comes to HA, everything Iā€™ve done so far is from guides that others with more knowledge have created.

I would look in that directory and see what serial port it is on (/dev/serial/by-id), and then validate that you are configured to use the correct port. It may have changed from RP4 to UTM, since that is not managed by HA. Sorry I canā€™t guide more, but it should be configured by the add-on you are using, as I said before Z-Wave JS UI

Thanks for the additional information, now to research and find out how to locate that directory and see what it holds. Thanks again for all the assistance so far!

Just use the terminal and SSH add-on which I imagine you probably already have installed.