Got two IPs of the container

Hi guys. I have a very strange problem.sometimes, the containers got two IPs.
When I restart it, maybe 1 minitues later, the container got another IP like “169.254.xx.xx”
I have export the images here: http://hseek.eu.org/d11.tar.gz

BYW: this images is based Debian11 and with lxde installed.
I have testing many times, and can’t fix this problem. thanks for helping.

169.254.x.x is a link-local IPv4 address, that’s self-assigned by the guest, not something we’d be pushing over DHCP or the like.

So that’s going to be because of some kind of configuration inside of your container.

yes, I have googled about this problem. And I did not make any configuration in the container.
I named it as a strange problem, because I made other image with same steps, but some container is ok, some have this problem.
The steps I made it like: install xrdp+lxde,remove libreoffice*. There are no other special operations.
I tried to modify the mac address of the container, operate in the Debian11/12 OS container, and change the host system to ubuntu/debian, but the problem still persisted.
So I hope guys import this image to help analyze the problem. Thanks.!

Not likely to have much time to try that in a little while as I’m traveling but normal networking rarely messes with link-local stuff, so my best guess is that you installing desktop stuff in there has pulled something like Network Manager or an equivalent into your system which is now making a bit of a mess.

Hope you can enjoy your journey. Thank you for your reply. I will continue to try to change the installed desktop. :sweat_smile:

It should be easy to add the appropriate service to a container and get the link-local special address.

The stock container images should not be affected.

This is the relevant log. I hope it can be helpful in solving this problem:

Jul 01 12:54:41 d11 dbus-daemon[168]: [system] Successfully activated service ‘org.freedesktop.PackageKit’
Jul 01 12:54:41 d11 systemd[1]: Started PackageKit Daemon.
Jul 01 12:54:56 d11 dbus-daemon[168]: [system] Failed to activate service ‘org.freedesktop.hostname1’: timed out (service_start_timeout=25000ms)
Jul 01 12:54:56 d11 systemd-networkd[157]: Could not set hostname: Method call timed out
Jul 01 12:54:56 d11 systemd-networkd[157]: Could not set hostname: Failed to activate service ‘org.freedesktop.hostname1’: timed out (service_start_timeout=25000ms)
Jul 01 12:54:56 d11 systemd-networkd[157]: Could not set hostname: Failed to activate service ‘org.freedesktop.hostname1’: timed out (service_start_timeout=25000ms)
Jul 01 12:55:11 d11 avahi-daemon[166]: Registering new address record for 169.254.84.18 on eth0.IPv4.
Jul 01 12:55:11 d11 connmand[169]: eth0 {add} address 169.254.84.18/16 label eth0 family 2
Jul 01 12:55:11 d11 connmand[169]: eth0 {add} route 169.254.0.0 gw 0.0.0.0 scope 253
Jul 01 12:55:11 d11 connmand[169]: eth0 {add} route 0.0.0.0 gw 0.0.0.0 scope 253


Jul 01 13:21:39 d11 systemd[1]: Starting Hostname Service…
Jul 01 13:21:39 d11 systemd[1184]: systemd-hostnamed.service: Failed to set up network namespacing: Permission denied
Jul 01 13:21:39 d11 systemd[1184]: systemd-hostnamed.service: Failed at step NETWORK spawning /lib/systemd/systemd-hostnamed: Permission denied
Jul 01 13:21:39 d11 systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=225/NETWORK
Jul 01 13:21:39 d11 systemd[1]: systemd-hostnamed.service: Failed with result ‘exit-code’.
Jul 01 13:21:39 d11 systemd[1]: Failed to start Hostname Service.
Jul 01 13:22:04 d11 dbus-daemon[168]: [system] Failed to activate service ‘org.freedesktop.hostname1’: timed out (service_start_timeout=25000ms)
Jul 01 13:23:56 d11 dbus-daemon[168]: [system] Activating via systemd: service name=‘org.freedesktop.hostname1’ unit=‘dbus-org.freedesktop.hostname1.service’ requested by ‘:1.33’ (uid=0 pid=1188 comm="hostnamectl status ")
Jul 01 13:23:56 d11 systemd[1189]: systemd-hostnamed.service: Failed to set up network namespacing: Permission denied
Jul 01 13:23:56 d11 systemd[1]: Starting Hostname Service…
Jul 01 13:23:56 d11 systemd[1189]: systemd-hostnamed.service: Failed at step NETWORK spawning /lib/systemd/systemd-hostnamed: Permission denied
Jul 01 13:23:56 d11 systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=225/NETWORK
Jul 01 13:23:56 d11 systemd[1]: systemd-hostnamed.service: Failed with result ‘exit-code’.
Jul 01 13:23:56 d11 systemd[1]: Failed to start Hostname Service.
Jul 01 13:24:21 d11 dbus-daemon[168]: [system] Failed to activate service ‘org.freedesktop.hostname1’: timed out (service_start_timeout=25000ms)
Jul 01 13:25:22 d11 systemd[1]: Reexecuting.
Jul 01 13:25:26 d11 dbus-daemon[168]: [system] Activating via systemd: service name=‘org.freedesktop.hostname1’ unit=‘dbus-org.freedesktop.hostname1.service’ requested by ‘:1.37’ (uid=0 pid=1323 comm="hostnamectl status ")
Jul 01 13:25:26 d11 systemd[1]: Starting Hostname Service…
Jul 01 13:25:26 d11 systemd[1324]: systemd-hostnamed.service: Failed to set up network namespacing: Permission denied
Jul 01 13:25:26 d11 systemd[1324]: systemd-hostnamed.service: Failed at step NETWORK spawning /lib/systemd/systemd-hostnamed: Permission denied
Jul 01 13:25:26 d11 systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=225/NETWORK
Jul 01 13:25:26 d11 systemd[1]: systemd-hostnamed.service: Failed with result ‘exit-code’.
Jul 01 13:25:26 d11 systemd[1]: Failed to start Hostname Service.
Jul 01 13:25:35 d11 systemd[1]: Received SIGTERM from PID 1180 (bash).
Jul 01 13:25:35 d11 systemd[1]: Reexecuting.
Jul 01 13:25:51 d11 dbus-daemon[168]: [system] Failed to activate service ‘org.freedesktop.hostname1’: timed out (service_start_timeout=25000ms)

Hello everyone, I’ve tried many methods for this issue but none of them worked. Could anyone import the above image and help me take a look at this very strange problem? Thank you

I’m just running into a similar problem. Every new container, since my upgrading the host machine to Trixie, and also using a Trixie container image, yields two IP addresses on eth0:

| i-jenkins        | RUNNING | 10.6.221.75 (eth0)  | fd42:994d:88fd:a44e:72d5:c44a:71bc:30e8 (eth0) | CONTAINER       | 0         | laptop-3 |
+------------------+---------+---------------------+------------------------------------------------+-----------------+-----------+----------+
| i-kube-control   | RUNNING | 10.6.221.180 (eth0) | fd42:994d:88fd:a44e:bdbf:156b:d739:2635 (eth0) | CONTAINER       | 0         | laptop-3 |
|                  |         | 10.6.221.179 (eth0) |                                                |                 |           |          |

In this example, i-jenkins uses a Bookworm image, while i-kube-control uses a Trixie image, both built from pretty much the same yaml files with distrobuilder. Every new container ends up having two addresses, N and N+1.

I’m currently running

laptop-3# dpkg -l |grep incus
ii  incus                                            1:6.18-debian12-202510310402              amd64        Incus - Container and virtualization daemon
ii  incus-agent                                      6.0.4-2+deb13u1                           amd64        Incus guest agent
ii  incus-base                                       1:6.18-debian12-202510310402              amd64        Incus - Container and virtualization daemon (container-only)
ii  incus-client                                     1:6.18-debian12-202510310402              amd64        Incus - Command line client
ii  incus-extra                                      1:6.18-debian12-202510310402              amd64        Incus - Extra tools

If I create the same container using ‘tofu’, then it has only one IPv4 address. Weird.

Here’s the tofu manifest:

resource "incus_instance" "i-kube-control" {
  name  = "i-kube-control"
  image = "on-debian-c-13-1"
  type  = "container"
  config = {
    "limits.cpu"    = "4"
    "limits.memory" = "4096MiB"
  }
  device {
    name = "root"
    type = "disk"
    properties = {
      "path" = "/"
      "pool" = "default"
      "size" = "10GiB"
    }
  }
  device {
    name = "eth0"
    type = "nic"

    properties = {
      nictype        = "bridged"
      parent         = incus_network.incusbr0.name
      "ipv4.address" = "10.6.221.179"
      "ipv6.address" = "fd42:994d:88fd:a44e:bdbf:156b:d739:2635"
    }
  }
}