Installation not responding in a KVM ( virtual machine)

I have installed Home Assistant on a Linux PC in a KVM virtual machine. I have followed the guidance on the Installation page and had no errors. When I tried the " you will be able to reach Home Assistant on homeassistant.local:8123" nothing happened and the same with other web address. I have been into the virtual machine and the install is answering commands OK. If I ping an IP from Home Assistant the command line completes the ping command but with no output. If I look in the virtual machine setting there is no IP address listed for the machine just a mac address. I have made sure that the port :8123 is permitted. Unfortunately the trouble shooting I have seen assumes you have got beyond this stage an suggests logging in via SSH, root privileges, etc.

Anyone have ideas why I have not been able to move on from this early stage?

One possible problem is the network you have setup on the host and the guest (HAOS) doesn’t have IP connectivity. The typical networking implementation on the host is to setup a kernel level “bridge” with the “bridge” having the IP address and have both the Host OS and the Guest OS connect to this bridge. Do you have something like this?

Your system cannot pickup a DHCP address. Possible issues:

  1. NIC not supported by HA
  2. Category cable to your LAN
  3. System not connected to your LAN using a category cable
  4. Your DHCP server cannot connect to your system

Yes, is sounds like what I have.

Whilst I have set this sort of think up in the past but it’s not my day job. I know it could be just one setting slightly wrong that is causing the issue but its finding that one setting that I need help with.

Do you think you can help?

First thing I would try is on your Host/Linux machine type ip addr and see if your “bridge” has an ip address (and this ip address is the same subnet as the rest of your home LAN)?
Next would be a question… are you using virt-manager to setup your guest VM? If yes, what is you “NIC” config…is it connected to this bridge?

ip addr gives

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 74:2b:62:ee:a3:26 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.100/24 brd 192.168.0.255 scope global dynamic noprefixroute enp3s0
       valid_lft 74626sec preferred_lft 74626sec
    inet6 fe80::7e8b:6340:7ea8:c271/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 18:5e:0f:4d:17:8c brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.111/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp2s0
       valid_lft 70390sec preferred_lft 70390sec
    inet6 fe80::1950:7eb8:cb23:3c07/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:cf:ae:e4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:cf:ae:e4 brd ff:ff:ff:ff:ff:ff
6: anbox0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.250.1/24 scope global anbox0
       valid_lft forever preferred_lft forever
    inet6 fe80::6872:ccff:fe75:dfa9/64 scope link 
       valid_lft forever preferred_lft forever
23: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master virbr0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:fa:32:f7 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fefa:32f7/64 scope link 
       valid_lft forever preferred_lft forever

So the first line is the lookback and has an ip of 127.0.0.1 so it is not on the same subnet?

I am using Virtual Machine Manager,

this is what it shows

image

OK, there are a couple of issues:

  1. What you have currently are “default” bridges setup by QEMU/KVM that don’t connect to anything outside the Host OS. What you really need is to setup a kernel bridge, usually named br0. This br0 will connect to the outside world using your Ethernet interface.
    Here is a community guide for setting “br0”. This community guide is for setting things up on an Ubuntu “Server” and it doesn’t use use Virt-Manager so you should ignore most everything else in that guide, so only focus on the part about setting up ‘br0’. You can also google around as there are several guides for setting up br0. In the community guide, they are using an Ethernet interface named eno1, but in your case, use enp3s0 instead. What you are trying to achieve in effect is connecting br0 to enp3s0 and giving address 192.168.0.100/24 to br0 instead of enp3s0 (your Host OS will start using br0 instead of enp3s0 for IP connectivity). br0 will then by used by your HA VM (see next)
  1. You are using NAT. This will allow you HA VM to reach outside your Host machine, but anything outside your Host machine can not initiate a connection to your HA VM (like DHCP, broadcast discoveries, etc).Once you have br0 setup and it has an IP address (this IP address will be for your Host OS to use), you will next go into virtual-manager and set the Network Source to be “Virtual Network (br0): Bridge Network” (Device model e1000 should work fine). After this, you can let DHCP assign an IP to your HA VM, and then you can http connect to it using http://homeassistant.local:8123 (and if you want you can then assign a static IP to HA)

Thanks, a lot to try there. I will read up and give it a go.

Thank for you for your help.