Hi there,
Currently i am having difficulties installing HomeAssistant in KVM/LibVirt (using cockpit-project machines plugin).
But that is also not entirely true, installing HomeAssistant is a breeze. But having networking available poses quite difficult.
Backstory: currently running HomeAssistant OS on a Rpi 4 (2gb ram version) and booted from an ssd.
This works fine, but i am now running into the limits of the pi and want something better.
Since I already have a home server for other purposes (a lot of docker containers) i was looking into migrating home assistant to it.
But not run it as docker container but install it in a VM for easier maintainability.
What i want to achieve:
Run both docker containers that are exposed through nginx (nginx-proxy-manager), have AdGuard home as dns in a docker container and next to that run home assistant in a virtual machine.
This all should run on Ubuntu Server 24.04.1 LTS
I thought this would be as easy as just install home assitant on a VM, start it and have it work. Here i got my first issue: the libvirt network is not able to start as dnsmasq is not able to start as adguard already is bound to port 53
.
To mitigate this, i’ve set dns enable to no
.
See full network config here (retrieved by sudo virsh net-dumpxl default
where default is the network name):
<network connections='1'>
<name>default</name>
<uuid>bd3673c4-c00a-4419-ad35-38e659c2d0eb</uuid>
<forward mode='open'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:0b:21:e3'/>
<domain name='default' localOnly='yes'/>
<dns enable='no'/>
<ip address='192.168.100.1' netmask='255.255.255.0' localPtr='yes'>
<dhcp>
<range start='192.168.100.2' end='192.168.100.254'/>
</dhcp>
</ip>
</network>
This allows the network to be activated.
When i boot HomeAssitant i see that it gets 192.168.100.74
as ip address.
See below how network info
looks:
I initially had my network configuration with
<forward mode='none'/>
but this resulted in HAOS not getting a gateway on the ipv4 interface.
No i would think everything is setup correctly at the home assitant VM side of things.
Then I created a new network in docker using: docker network create -d macvlan --subnet=192.168.100.0/24 --gateway=192.168.100.1 -o parent=virbr0 virbr0_macvlan
And have the Nginx container join that network. To be safe also a restart of that container.
See below the attached networks for that container in Portainer:
Lastly I’ve added a proxy host for home assitant like this:
But when I go to test1.home I get presented a 400: Bad Request
page.
I did see one time that i could go to the home assitant page, but no idea anymore what i changed then. I believe it was the same config as above, but i cannot reproduce that anymore.
At least i know that i got presented with an error that home assistant is not able to get the DNS server or something. Where you can select if you want to use cloudflare or some other dns server. Those buttons were greyed out.
So i think it couldn’t even reach internet. Which is also a problem.
I know this is kind of a long shot, as this is really a technical problem, but not sure how to proceed with this.
I did find a lot of topics on the web stating that Libvirt and Docker do not play nice in terms of networking. Well that is definitly the problem here.
But since this server is kind of a production environment, i do not want to just try out all the commands i can find.
Does anyone have an idea what i am missing or doing wrong here?
Thanks in advance!