[HACK] Runnig Home Assistant OS from a non VM supporting Synology NAS

As Home Assistant Supervised is not supported on Synology the option is to run Home Assistant OS in a VM. However, not all Synology models have official VM support.

This is just a hack, I’ll try to wrap this together better later.

  1. Install synoKVM from https://github.com/bsdcpp/synoKVM/releases/tag/1.6
  2. Make sure Open vSwitch is enabled.
  3. Fire up a Terminal to your NAS and run this.
    # Download packages
    wget https://github.com/home-assistant/operating-system/releases/download/5.11/hassos_ova-5.11.qcow2.xz
    wget https://github.com/clearlinux/common/raw/master/OVMF.fd
    xz -k -d -v hassos_ova-5.11.qcow2.xz   
    
    # Create tap0 device
    sudo ip tuntap add dev tap0 mode tap user $(whoami)
    sudo ovs-vsctl add-port ovs_eth0 tap0 
    sudo ip link set tap0 up
    
    # Start qemu
    sudo /var/packages/synokvm/target/synokvm/bin/qemu-system-x86_64  \
      -vnc :0 -m 1.5G -enable-kvm \
      -drive if=virtio,file=hassos_ova-5.11.qcow2 --bios OVMF.fd \
      -device e1000,netdev=network0,mac=52:55:00:d1:55:01 \
     -netdev tap,id=network0,ifname=tap0,script=no,downscript=no
    
  4. Send me a beer :stuck_out_tongue:.
6 Likes

I have 2 errors :

ovs-vsctl: no bridge named ovs_eth0

and

/var/packages/synokvm/target/synokvm/bin/qemu-system-x86_64: /lib/libcrypto.so.1.0.0: no version information available (required by /usr/local/synokvm/lib/libspice-server.so.1)
/var/packages/synokvm/target/synokvm/bin/qemu-system-x86_64: /lib/libssl.so.1.0.0: no version information available (required by /usr/local/synokvm/lib/libspice-server.so.1)
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory

You need to enable vSwitch for the first one. I don’t know what happened for the second one, but it looks like you haven’t loaded the kvm module.

What model du you have and what is the output of uname - a?

Now I regret I moved to DSM 7 Beta. synoKVM package is not compatible with it :confused:
That also means you’ll hit another issue sooner or later.

Yes, this is a hack and proof of concept.

Perhaps we can build the required modules (drivers) for the DSM 7 kernel too. But this is just to show that there exists options.

I might save up to a model that supports VM natively myself (the DS220+ looks promising, and is not super expensive compared to).

1 Like

I will try to update synoKVM package tomorrow. I’ve got DS216+ with RAM upgraded to 8GB and it is definitely capable to virtualize stuff. No idea why Synology decided that it is not.

BTW what’s the kernel on DSM 6.x?
This from DSM 7 doesn’t really look like something recent :slight_smile:

[email protected]:~$ uname -a
Linux backup 3.10.108 #41222 SMP Fri Dec 4 18:58:40 CST 2020 x86_64 GNU/Linux synology_braswell_216+
uname -a                                                            
Linux SynHome 3.10.105 #25426 SMP Tue May 12 04:44:40 CST 2020 x86_64 GNU/Linux synology_braswell_716+II

It looks like you didn’t manage to load the module provided un synoKVM.

synoKVM doesn’t provide module. It’s available in regular Synology kernel.

sorry for my weak testing, but the problem may be that I have a DS220 +
by the way, what would the procedure look like if for DS220 + ?

No problem., I needed to write down what we found…

If you have a ds220+ you shouldbe able to run https://www.synology.com/en-global/dsm/packages/Virtualization and just add the image from there.

I found for the first error (I think) : it’s because my bond network.
But for the second, I don’t why

For information, I run Xpenology on a HP n54L.

 uname -a
Linux mon-serveur 3.10.105 #25426 SMP Mon Dec 14 18:46:52 CST 2020 x86_64 GNU/Linux synology_bromolow_3615xs

What I have to do?

Well, if you are running a virtual machine it should be easy…

Just start another vm with hass-os.

This is not a VM.

Why do you think I run a VM?

So this works?

sudo /sbin/insmod /lib/modules/kvm-intel.ko nested=1 enable_apicv=0

Because of this https://www.wundertech.net/how-to-install-xpenology-on-a-linux-kvm-qemu-virtual-machine/

But it seems like virtual machine manager might work for you.

Xpenology isn’t installed on a VM but directly on my HP N54L.

(For the moment, I can’t access anymore to my NAS : it says there is no more place on my disk. Impossible to access to it by ssh…But it’s an other issue).

I’ll come back when it will be resolved.

Yeah modules are there. I think what synoKVM does is compiling libvirt / qemu tools to make use of these modules.

[email protected]:~$ sudo /sbin/insmod /lib/modules/kvm-intel.ko nested=1 enable_apicv=0 
Password: 
[email protected]:~$ sudo lsmod | grep kvm
kvm_intel             125880  0 
kvm                   348611  1 kvm_intel

Ok, so there are some confusion even here. This hack was kind of a workaround for models that don’t have VMM available.

Here is a guide to the VMM version: Installation on Synology Virtual Machine Managager

@BeardedConti Perhaps you can help me with a better guide…

1 Like

:smiley: You are so fast, I can’t follow you :smiley:
Currently testing on my recording (Xpenology) setup - need also to try it on non-VM 415+.

1 Like