How to launch Launch lxd container with predefined ip address

suppose, t as lxd container.
root@vmi307975:~# lxc launch ubuntu:18.04 t Creating t Starting t root@vmi307975:~# lxc list t | RUNNING | **** (eth0) | fd42:465a:4c31:7538:216:3eff:fe60:9040 (eth0) | CONTAINER | 0
My question:
I want ip address of t container as ‘’ instead of ‘’ as self decided by lxd container while launching.

Is there any syntax i can use to launch an lxd container and assign it an ip.

Well maybe I missunderstand something, but shouldn’t it be possible to set an ip adress in a profile?

See for example:
and in case of ipv6: ipv6.address

But beware, you need to use a managed network for this, as shown by:
lxc network list

Then you would launch the container with your profile:
lxc launch ubuntu:18.04 -p network1

You can also attach and detach profiles to already existing containers.

Thanks Toby for help

1 Like