Hassos vm and what network im on - the ipaddress assignment

Hoping id have figured this out over the past 6 months, but, throwing this out there.
Sometimes I want to test some stuff on a homeassistant setup i have on a oracle virtual machine on windows.

When I have the network bridged, set to cable connected, It all goes good. No issues there.

At home, my computer gets a 192.168.1.92 address, the vm gets a 1.x via dhcp

At work, my entire network gets 192.168.2.xx address, and when I start my VM, it still wants to have the 1.x IP

Ive tried network reload via cli, and I also have that vm instance set to dhcp inside homeassistant.

however i cant for the life of me figure out how to get it to just join the network and get an IP of its own easily.

id just semi try to make it get a static address from wherever I go, but sometimes ill be at a friends and wanting to mess with the vm and dont wanna make it a issue there, with router access and etc.

Any advice? Thanks!

Can’t help you with the networking, but can you use Nabu Casa (or whatever remote you have setup) services to connect to your HA instance?

I’m not sure, but as a general statement, if an entity gets an address from DHCP and doesn’t realize it has been moved to a new network, it will continue to use the last address DHCP assigned it until its lease time expires. So when you move to a different network, either reboot HA, or bounce its link down/up, either of which should cause it to ask for a new address.

1 Like

I’m thinking the same as above here…

Could it be the DHCP lease hasn’t expired yet ?

When a device gets an IP address from DHCP, the DHCP also passes an expiration date/time.
The device will not try to renew the IP before it expired.
This time is configurable in most routers…

I restart the VM entirely as if i was booting up a standard device, and it doesnt get a new IP address, Just to touch base on that.

In the oracle vm, in settings, there is a Network tab, and it allows up to 4 different adapters.

Regardless of the changes I made to the ‘Adapter 1’ and countless reboots, resets, and restarts, the solution was disabling adapter 1, and just creating an ‘adapter 2’ and vice versa for when i start the VM at home.

Issue solved. Thanks anyone that looked.