Hi all,
I am trying to set up a container with a fixed IP in order to use a proxy device in NAT mode.
I have done this in the past, but now with LXD 4.17 I am running into several errors.
First I am wondering why one cannot specify a fixed IP address right at the beginning when launching a new container.
david@nnwh:~$ lxc launch ubuntu-minimal:focal c1 -c ipv4.address=10.65.76.163
Creating c1
Error: Failed instance creation: Failed creating instance record: Unknown configuration key: ipv4.address
And one cannot set it in one step either:
david@nnwh:~$ lxc config device set c1 eth0 ipv4.address 10.65.76.163
Error: Device from profile(s) cannot be modified for individual instance. Override device or modify profile instead
So it seems one needs to do this in several steps manually.
david@nnwh:~$ lxc stop c1
david@nnwh:~$ lxc network attach lxdbr1 c1 eth0 eth0
david@nnwh:~$ lxc config device set c1 eth0 ipv4.address 10.65.76.163
Now we have a container with a fixed IP address.
And now we want to define a proxy device in NAT mode.
david@nnwh:~$ lxc config device add c1 h22c1 proxy listen=tcp:xxx.xxx.xxx.xxx:16322 connect=tcp:127.0.0.1:22 nat=true
Device h22c1 added to c1
That seems to have worked. However, we cannot start the container anymore:
david@nnwh:~$ lxc start c1
Error: Proxy connect IP cannot be used with any of the instance NICs static IPs
Trylxc info --show-log c1for more info
david@nnwh:~$ lxc info --show-log c1
Name: c1
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2021/09/02 08:26 UTC
Last Used: 2021/09/02 08:38 UTCLog:
lxc c1 20210902083815.566 WARN conf - conf.c:lxc_map_ids:3389 - newuidmap binary is missing
lxc c1 20210902083815.566 WARN conf - conf.c:lxc_map_ids:3395 - newgidmap binary is missing
lxc c1 20210902083815.567 WARN conf - conf.c:lxc_map_ids:3389 - newuidmap binary is missing
lxc c1 20210902083815.567 WARN conf - conf.c:lxc_map_ids:3395 - newgidmap binary is missing
lxc c1 20210902083815.568 WARN cgfsng - cgroups/cgfsng.c:fchowmodat:1293 - No such file or directory - Failed to fchownat(43, memory.oom.group, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc c1 20210902083816.774 WARN conf - conf.c:lxc_map_ids:3389 - newuidmap binary is missing
lxc c1 20210902083816.843 WARN conf - conf.c:lxc_map_ids:3395 - newgidmap binary is missing