fredrike
(Fredrik Erlandsson)
February 16, 2021, 3:15pm
1
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.
Install synoKVM from https://github.com/bsdcpp/synoKVM/releases/tag/1.6
Make sure Open vSwitch is enabled.
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
Send me a beer .
6 Likes
mitch55
(Sébastien)
February 16, 2021, 3:52pm
2
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
fredrike
(Fredrik Erlandsson)
February 16, 2021, 4:59pm
3
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
?
fEnIo
(Bartosz Feński)
February 16, 2021, 5:15pm
4
Now I regret I moved to DSM 7 Beta. synoKVM package is not compatible with it
That also means you’ll hit another issue sooner or later.
fredrike
(Fredrik Erlandsson)
February 16, 2021, 5:20pm
5
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
fEnIo
(Bartosz Feński)
February 16, 2021, 5:23pm
6
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.
fEnIo
(Bartosz Feński)
February 16, 2021, 5:25pm
7
BTW what’s the kernel on DSM 6.x?
This from DSM 7 doesn’t really look like something recent
fenio@backup:~$ uname -a
Linux backup 3.10.108 #41222 SMP Fri Dec 4 18:58:40 CST 2020 x86_64 GNU/Linux synology_braswell_216+
fredrike
(Fredrik Erlandsson)
February 16, 2021, 5:51pm
8
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.
fEnIo
(Bartosz Feński)
February 16, 2021, 6:11pm
9
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 + ?
fredrike
(Fredrik Erlandsson)
February 16, 2021, 8:37pm
11
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.
mitch55
(Sébastien)
February 16, 2021, 8:42pm
12
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?
fredrike
(Fredrik Erlandsson)
February 16, 2021, 8:43pm
13
Well, if you are running a virtual machine it should be easy…
Just start another vm with hass-os.
mitch55
(Sébastien)
February 16, 2021, 8:48pm
14
This is not a VM.
Why do you think I run a VM?
fredrike
(Fredrik Erlandsson)
February 16, 2021, 8:50pm
15
So this works?
sudo /sbin/insmod /lib/modules/kvm-intel.ko nested=1 enable_apicv=0
fredrike
(Fredrik Erlandsson)
February 16, 2021, 8:58pm
16
mitch55:
Xpenology
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.
mitch55
(Sébastien)
February 16, 2021, 10:16pm
17
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.
fEnIo
(Bartosz Feński)
February 17, 2021, 4:52am
18
Yeah modules are there. I think what synoKVM does is compiling libvirt / qemu tools to make use of these modules.
fenio@backup:~$ sudo /sbin/insmod /lib/modules/kvm-intel.ko nested=1 enable_apicv=0
Password:
fenio@backup:~$ sudo lsmod | grep kvm
kvm_intel 125880 0
kvm 348611 1 kvm_intel
fredrike
(Fredrik Erlandsson)
February 17, 2021, 8:33am
19
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
You are so fast, I can’t follow you
Currently testing on my recording (Xpenology) setup - need also to try it on non-VM 415+.
1 Like