How to ensure debain VM keeps IP

Hi all,

I have set up a few VM’s running debian 12.
I am looking to run things like AMP which requires the VM to have the same local IP and Home Assistant.

I managed to set up AMP fine and could access the app without issues until i restarted the VM as per AMP request, and then couldn’t access it anymore. Looking at the IP in the VM, it had changed.

My Scale is on a static IP and not using DHCP but this is still changing the VM’s local IP addresses each time they restart.

I am sure its a simple fix, but I can’t seem to find how to stop the VM’s getting new IP addresses on each restart.

Thank you for your time and help!

This is a configuration issue inside your VM’s guest OS. IIRC Debian still uses /etc/network/interfaces. Edit that and set a static IP address.

1 Like

It’s been a while since i’ve used vm’s, but when i was i set a static ip via netplan.
Here’s a guide on how to use netplan

Thank you so much. I had to go about it in a slightly different way as the command couldn’t find any of the yaml files for some reason, but i got there and have restarted the VM a few times and it has the IP I set.

So thank you!