Installation on Synology Virtual Machine Managager

@sinegovsky-ivan:
you don’t have to move SSL keys. It’s pretty simple, (i guess you mean run HA from docker).
in Synology you do:
Control Panel --> Application Portal --> Reverse Proxy:

Source:
Protocol: HTTPS
Hostname: protoncek.synology.me
Port: 443

Destination:
Protocol: HTTP
Hostname: localhost
Port: 8123

Custom Header:
Create --> WebSocket --> ok

Control panel --> External Access -->Router configuration:

Create -->Built-in application
Enable HTTPS, Reverse Proxy 443 443 TCP

In your router make port forwarding from 443 external to 443 internal, pointed to your local IP. Done.
This way HA will be accesible in yourname.synology.me, while NAS will be at yourname.synology.me: NAS-port-number

2 Likes

it doesn’t work :frowning:
I want to use my homeAssistant via https--myacc.synology.me:8123 :

I set reverse proxy 8123 (nas) -> 8123 (synology). My router port forwarding set to synology (8123 port).

However, when I open https://myacc.synology.me:8123 i see “ERR_FAILED”.

Should I add some settings to homeassistant instance? E.g. “external_url” etc

I’m not sure, but i think that using 8123 won’t work, because it’s already occupied with http page. You can’t have same port on both http and https. Try a different port. Using 443 is most easy, because 443 is default https port (same as it is 80 for http) so you don’t have to tyep in port each time. .
I have synology set to redirect http to https so i don’t acces it via http, only https and i have to use my custom port, not default 5000 or something similar.
Also don’t forget to do port forwarding in your router.

So I took the step and migrated all to VM. It took some small tweaks on two of my integrations (NUT and Samsung TV) but overall super smooth. For now I left mqtt and zigbee2mqtt on Synology in docker where it was allready separated from HA. All my USB devices (zwave stick and UPS cable) works on VM without issue.

Thank you @fredrike for this wonderfull ride so far and for all your great work. Enjoy your well earned beers. :beers: :+1:

My setup:

  • Synology DS918+ with 16 GB RAM
  • VMM: 2 CPU cores, 2 GB RAM, 64 GB storage
  • At idle Synology CPU stays around 5% :+1:
  • I don’t see any significant performance drop on VMM

Now to uninstall the Synology Hass.io package… :wave:

EDIT: I have one question. I had a regular scheduled task in Synology to copy Synology certs (fullchain.pem and privkey.pem) to homeassistant/ssl folder (docker). What is the best way to automatically copy those cert files to VMM HA ssl folder? Is there a way to expose a folder in VMM to DSM?

3 Likes

You can expose that part of HA either with the Samba addon or one of the Terminal/SSH addons. Whatever you prefer.

To copy the certificates I also use the Samba-Share addon.
On the Synology I have created a shared folder pointing to the Samba share in Homeassistant.

On the Synology under Data Services NFS must be enabled.

1 Like

So, here’s my story:
I did as i wrote above : removed one HDD, formated it, put it back and made a second btrfs volume on now “degraded” Syno. Then i installed HA according to @fredrike’s and @BeardedConti’s guides. Installation went perfect, all is running.

On my DS920+ with 8GB of RAM i assigned 2 CPU’s and 2GB of memory for VMM, vhich proved more than enough. Synology shows real CPU usage of max. 30% (it goes as low as 5% at times), RAM is at 50%. Supervisor shows a few percent of CPU usage and around 10% of RAM usage. HA runs smoothly and quick, for now i have around 10 add-ons from HACS and 4 from supervisor add-on store.

I would point out one thing regarding HACS installation: on HACS installation page it’s definitely not highlighted enough that you MUST clear browser cache in order to see HACS in integrations at all. Unless you do that it’s not available so you can’t add it in to HA.

HTTPS access: it’s way easier to set than i ever expected. All it’s needed is change one setting from my above guide:

Destination:
Protocol: HTTP
Hostname: 192.168.0.x ← IP of my new HA in VMM (not localhost anymore)
Port: 8123

After that entering https://whateverishere.synology.me shows my new HA page. No tinekring around with let’s encrypt or duckdns needed.

Now i have to put my Syno in order from degraded state - move all shared folders to volume2, delete volume1 and expand volume2.

At the end i would like to thank to @fredrike and @BeardedConti again for your guides and answers. Many thanks! You make us, not so knowledged people life hughely easier!

2 Likes

I went the SSH way as enabling NFS on Synology is not considered very secure (as I read somewhere). I managed to create a scheduled task on Synology that regularly copies updated Synology fullchain.pem and privkey.pem to HA SSL folder. So far so good. The only thing that I can’t figure out is how to remotely restart HA core after the cert is updated. I tried:

ssh user@ha_ip "ha core restart"

but that returns

Unexpected server response. Status code: 401

In supervisor log there is

WARNING (MainThread) [supervisor.api.security] No API token provided for /core/restart

Is there any way how can I restart HA core via SSH from DSM? Or does it even needs to be restarted in order to load new cert files?

What exact modules you are running on 918+? I used some about a year ago and the NAS was not stable. 4GB is not enough for this setup I am currently preparing.

It looks that everybody does not have any troubles, unfortunately I am stuck just at the beginning

Scroll back to the posts on 21-2, you will see this exact error mentioned.

HyperX Impact 16GB (Kit 2x8GB) 1866MHz DDR3L CL11 SODIMM 1.35V

Works perfect without any issues.

Worked like a charm and the NAS has been running for several days without any issues. The VM does increase disk usage though, creating small activity every few seconds. Maybe I’ll add an SSD in one of the bays and move it there…

My synology freezed after one year being up. I dont believe it’s even possible, but it seems that vmm let me alocate more memory over the minimum the nas needed. I am not sure whether having HA, which tends to be hungry for resources, on nas is a good idea. Tell me I am wrong and I will give it another shot

How much RAM does your Syno have and how much of it did you give to VM?

DS918+ with 4GB and I gave 1,5GB to the VM. Original mem as those I bought year ago made the NAS unstable.

I would expect VMM would not let me to allocate too much to freeze the NAS. Or am I wrong?

DS220+ 18GB (i know CPU has official 8 GB limit) and i made more tests and now i am use for VMM 1 CPU and 3GB RAM (HA use 9 addon packages and 2 in docker )

Hi, I also installed HA in Synology VMM and everything is fine, but I have a strange loop in the supervisor log:

21-03-08 08:12:14 INFO (MainThread) [supervisor.plugins.audio] Starting Audio plugin
21-03-08 08:12:14 INFO (SyncWorker_2) [supervisor.docker.interface] Cleaning hassio_audio application
21-03-08 08:12:15 INFO (SyncWorker_2) [supervisor.docker.audio] Starting Audio homeassistant/amd64-hassio-audio with version 2021.02.1 - 172.30.32.4
21-03-08 08:13:15 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with PulseAudio plugin!
21-03-08 08:13:15 INFO (MainThread) [supervisor.plugins.audio] Starting Audio plugin
21-03-08 08:13:15 INFO (SyncWorker_3) [supervisor.docker.interface] Cleaning hassio_audio application
21-03-08 08:13:16 INFO (SyncWorker_3) [supervisor.docker.audio] Starting Audio homeassistant/amd64-hassio-audio with version 2021.02.1 - 172.30.32.4
21-03-08 08:14:16 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with PulseAudio plugin!

Anyone here with the same loop? Can the pulse audio be disabled? Or at least stop the endless start-crash loop?

Also a few recomendations of what i have optimized (I have DS620slim):

  • I have allocated 2 GB of RAM and 1 CPU (with 2 cpus it made my host to crash a couple of times, and with 1 the performance is fine)
  • As I have 6 bays, I have 4 with HDDs for data and 2 SSDs for working apps libraries (Plex, Moments, etc…). Adding this 2 SSDs (in SHR or RAID1) and moving the VMM storage to the SSDs was a huge improvement in performance.
  • I also installed Maria-DB in Synology and connected HA to Maria-DB instead of using the internal DB also helped to feel everything faster.

Hello @fredrike,
may I ask why I see “You are running an unsupported installation” also here with the VM environment?
My plan was to migrate from the Synology HA package based on Docker you created since it is no more supported.
Do we have the same issue he with VMM? Thanks!

I’ve had his package in docker, it was unsupported, too. From my understanding the main problem is that Synology doesn’t update it’s docker addon, while old one is not good for newest HA anymore.
I transferred all into VM in Synology and all is fine, running and supported. Just do according to first post in this thread. Of course you need btrfs partition…