[Solved] Cannot get an IP for HomeAssistant VM

tmbiv56

New Member
Feb 20, 2023
12
4
3
I'm sorry if this is a duplication.
I installed proxmox 6 in a partition on Debian Buster.
After installation, I used Proxmox to upgrade to version 7.3.6.
I did no configuration on the PVE network adapater for the installation. I configured a static iP for the Debian OS.
Here is the PVE network adapter configuration:
1676939267803.png

My network is a simple home network. No VLANS, or anything else.

I created the HomeAssistant VM from the .vmdk image found at https://www.home-assistant.io/installation/linux
I added a vmbr0 network device to the VM and this is how it is configured.
1676939179601.png

When I run the VM, the Home Assistant has no IP address, and therefore, I cannot open the GUI for it.
I have tried adding IP addresses in the PVE adapter, but nothing gets passed to the VM.

What are the steps required to get my Home Assistant VM working?
Thanks.
 
When I run the VM, the Home Assistant has no IP address, and therefore, I cannot open the GUI for it.
I have tried adding IP addresses in the PVE adapter, but nothing gets passed to the VM.
You have to set the IP inside the VM. You can use the VMs console for that:
1676941469042.png
 
Last edited:
Thank you for your response. I tried your suggestion this morning.
I attempted to set the ipv4-gateway and the ipv4-address. Both commands returned a timeout error:
"Post "http://supervisor/network/interface/enp0s18/update": context deadine exceeded. (Client.Timeout exceeded wiel awaiting headers)

It's interesting that none of the tutorials regarding installation of HAOS said anything about having to configure the IP.
 
I looked up the timeout issue, but I don't know anything about docker hub.
I did change the DNS on my linux machine to be 8.8.8.8 as it says in this tutorial: https://www.techrepublic.com/article/resolve-docker-timeout-headers-error/
I re-configured the network update command like this:
network update enp0s18 --ipv4-method static --ipv6-method disabled --ipv4-gateway "192.168.xxx.xxx" --ipv4-address "192.168.xxx.xxx"
This command was completed successfully.
However, the IP address did not show up on my router, I could not ping the IP, and the http://IP:8123 did not bring up the Home Assistant
Here's a screenshot.
1676988727378.png
 
  • Like
Reactions: mluleki
Would configuring the IP inside the HAOS as you suggest, be a persistent solution?
I would not want to have some kind of reset and have the HAOS not re-connect.
 
Last edited:
What does your hosts /etc/network/interfaces look like? And did you install Debian with an desktop environment?
Maybe your hosts config is just wrong.
I think HAOSs default is DHCP on all interfaces.
 
Last edited:
In answer to your first question, yes, the linux boots to the debian desktop.
I have been attempting different configurations of Linux Bridge.
Let me start at the beginning.
I have removed all the virtual bridges from Proxmox and only have the original enp1s0 network device.
I have configured the gateway IP in that device, but left the IP address blank.
The resulting entry in the /etc/network/interfaces file is this:
------------------------------------------------------
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual
gateway 192.168.xxx.1
----------------------------------------------------------
The problem with this configuration is that the ethernet does connect on boot.
I originally configured this machine with a static IP from my router so that I can remote into the machine without having to wonder what IP it has.
I have been fighting with Proxmox over the static IP address, and I think it is fruitless.
I'm wondering if I should try giving Proxmox the static IP by configuring the IP in Proxmox here:
1676997421821.png
As it stands now, I can only get Proxmox by connecting via the wifi IP:8006.

Just remembered. When I put an IP address in the dialog box above, then I am unable to add virtual adapters. They give the error "iface enp1s0 - ip address can't be set on interface if bridged in vmbr0 (500)"

The result is that I don't know where to put a static IP so I can open proxmox reliably, and also assign IP addresses on the virtual bridges so that the VM's can use them.
 
Last edited:
I tried removing the IP address from the enp1s0 and then adding vmbr0 without any IP.
Then I added vmbr1 and put in an IP address.
The result was that I could not connect to the ProxMox interface.
The /etc/network/interfaces file looked like this:
---------------------------------------
auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual
gateway 192.168.999.1

auto vmbr0
bridge-ports enp1s0
bridge-stp off
bridge-fd 0

auto vmbr0
address 192.168.999.20/24
bridge-ports none
bridge-stp off
bridge-fd 0
---------------------------------------

I'm really at a loss on how to get this working.
If Proxmox continually sets the emp1s0 device to manual, then I will be unable to connect to proxmox.
I know I am doing something wrong.
 
Last edited:
Yeah removing the linux bridges from proxmox altogether was not the right direction. try the below for your /etc/network/interfaces:

Code:
auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual

auto vmbr0
iface enp1s0 inet static
address 192.168.999.20/24
gateway 192.168.999.1
bridge-ports enp1s0
bridge-stp off
bridge-fd 0

For the vmbr0 - address line use whatever IP you initially set up to get to the proxmox host WebGui if it is not 192.168.999.20. After making those changes to the file run ifreload -a. Once you have that working (the proxmox webgui is accessible) then as long as a DHCP server is set up either from the 192.168.999.1 gateway or in the 192.168.999.0/24 subnet, Homeassistant should pick up an IP if the VM uses vmbr0 as its bridge. You likely want to make this a reserved DHCP address for HA too.
 
Last edited:
In answer to your first question, yes, the linux boots to the debian desktop.
This might cause problems. I for example had to remove the NetworkManager package that got installed together with the default desktop environment because that always screwed up PVEs network configs.

auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual
gateway 192.168.999.1

auto vmbr0
bridge-ports enp1s0
bridge-stp off
bridge-fd 0

auto vmbr0
address 192.168.999.20/24
bridge-ports none
bridge-stp off
bridge-fd 0
I hope you aren't really using "999" there, as that is not valid. There is by the way no point hiding a local IP. That makes it just harder to help with redacted configs.

And that config is wrong anyway. Should look like this:
Code:
auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual
  
auto vmbr0
iface vmbr0 inet static
    address FREE.IP.OFYOURROUTERS.SUBNET/YOURSUBNETSCIDR
    gateway Your.Routers.IP.ADDRESS
    bridge-ports enp1s0
    bridge-stp off
    bridge-fd 0
 
Last edited:
Thanks again Dunuin!
I have finally gotten things configured, and as it turns out, it does match what you just posted. I appreciate your help.
Not using 999...
I got the IP to migrate to the homeassistant VM.
Actually, what I didn't understand, was that I needed to put the static IP that I wanted to assign from the router into the vmrb0 bridge, as you show above. I just wasn't understanding.

I added a 2nd network device, gave it another IP and attached that to my HomeAssistant VM.
My only problem now is that when I use http://192.168.77.20:8123 from my main desktop, I cannot bring up the HA login window. It just says unreachable. Unsure if it's a HAOS thing or my VM thing now.

1677014112971.png

/etc/network/interfaces is :
--------------------------------------------------
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual

auto vmbr0
iface vmbr0 inet static
address 192.168.77.48/24
gateway 192.168.77.1
bridge-ports enp1s0
bridge-stp off
bridge-fd 0

auto vmbr1
iface vmbr1 inet static
address 192.168.77.20/24
bridge-ports none
bridge-stp off
bridge-fd 0
--------------------------------------------------

Thanks again.
Making progress. :-)
 
auto vmbr0
iface vmbr0 inet static
address 192.168.77.48/24
gateway 192.168.77.1
bridge-ports enp1s0
bridge-stp off
bridge-fd 0

auto vmbr1
iface vmbr1 inet static
address 192.168.77.20/24
bridge-ports none
bridge-stp off
bridge-fd 0
PVE is only providing virtual hardware. It won't have anything to do with what happens inside the VM. PVE can't assign a IP to a VMs OS (unless you use cloud-init). All the home assistant network config has to be done inside the VM by home assistant. The IP you assign in PVE is just for the PVE Host, so you can access the PVE webUI and so on.

And your vmbr1 won't do anything, as you neither use a routed/NAT setup nor did you bridge it to a physical interface.
And a OS shouldn't use two IPs of the same subnet. So you can't use 192.168.77.20/24 together with 192.168.77.48/24.

And your home assistent is using a "/32" subnet, which should be "/24". Otherwise you won't be able to access it with any other IP that is not 192.168.77.20.
 
Last edited:
I noticed that /32 as well and wondered where that came from.
Thanks for the information.
I'll try to configure HAOS from within the VM.
 
Woohoo!!!
Finally got it working.
After creating the first Linux Bridge (vmrb0) that was bridged to the ethernet adapter, I would create one new Linux Bridge object for each VM so that I could assign a static IP to the VM.
While I could ping the static IP from outside, I could never reach the outside from the VM. It simply wasn't being routed.
I really don't know much about all of that stuff.

So, I removed the vmbr1 Linux bridge from the VM and assigned vrmb0 to the VM.
This worked. The VM received a DHCP IP from my router and now I could open the HomeAssistant portal :8123 using the given IP.

I am going to try using my router and the MAC address of the VM bridge object to create a static IP for the HomeAssistant.

That's it for now.

I would like to understand how to overcome this and to be able to create a vmbr1 with a static IP and get it to be routed outside.
 
After creating the first Linux Bridge (vmrb0) that was bridged to the ethernet adapter, I would create one new Linux Bridge object for each VM so that I could assign a static IP to the VM.
Again, that is not how it works. With a single NIC and/or without VLANs you usually don't want more than one bridge. Assigning a IP to a bridge won't have anything to do with the VM. That IP is for the PVE host itself, not for the virtual machine or guest OS.
 
Last edited:
@tmbiv56 think of each Linux bridge as virtual managed switch with unlimited ports. The IP address and gateway directly assigned to it are for the Proxmox host connection to that virtual switch not the vm/LXC

VM/LXC can all attach to that same virtual switch and comunicate with the Proxmox host through its assigned IP/subnet or be segregated from it through different vlans.
 
  • Like
Reactions: Dunuin
Thank you. Here is my /etc/network/interfaces file:
auto lo
iface lo inet loopback

iface enp1s0 inet manual

iface wlp2s0 inet manual

auto vmbr0
iface vmbr0 inet static
address 192.168.77.10/24
gateway 192.168.77.1
bridge-ports enp1s0
bridge-stp off
bridge-fd 0

I am only using one Linux bridge device (vmbr0).
On my VM, I attach a network device, which assigns a MAC to the VM. (right?).
1677858935074.png
My router sees the new MAC and issues an IP for it.
But, in my case, I tell the router to make this a static IP.
Is this not an approved method?
 
  • Like
Reactions: vesalius

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!