I am trying to configure a incus instance using a preseed file. The plan is to run a simple mariadb instance in a container as a test. I cannot seem to correctly configure my network in a way that it is accessable to the outside world. Logging into the database from the container works fine. I can see my port open, and a local connection to the db works great:
[root@nixos:~]# netstat -tuplen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 84 161839 512/mysqld
tcp6 0 0 :::3306 :::* LISTEN 84 161840 512/mysqld
tcp6 0 0 :::22 :::* LISTEN 0 151309 1/systemd
udp 0 0 0.0.0.0:68 0.0.0.0:* 999 161795 437/dhcpcd: [manage
udp6 0 0 :::546 :::* 999 161836 437/dhcpcd: [manage
Outside the container, I cannot seem to connect to the instance when it has its default configuration:
(included for reference:)
$> incus profile show default
config: {}
description: Default Incus profile
devices:
eth0:
name: eth0
network: incusbr-1000
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:
- /1.0/instances/lxcTest-container?project=user-1000
project: user-1000
And I cannot try to modify the default profile so that it works properly.
When I try to run
incus init lxcTest-aaimage-8b90e8 lxcTest-container < /nix/store/bprz29fqxk8lwkqv1zaym463npyi5iy9-preseed.yaml
I receive a parser error:
Error: yaml: unmarshal errors:
line 13: cannot unmarshal !!map into string
The generated yaml is valid json:
{
"networks": [
{
"config": {
"ipv4.address": "auto",
"ipv6.address": "auto"
},
"name": "lxdbr0",
"type": "bridge"
}
],
"profiles": [
{
"devices": {
"eth0": {
"name": "eth0",
"network": "lxdbr0",
"type": "nic"
},
"root": {
"path": "/",
"pool": "default",
"type": "disk"
}
},
"name": "default"
}
],
"storage_pools": [
{
"config": {
"source": "[redacted path]"
},
"driver": "dir",
"name": "default"
}
]
}
But, in a attempt to diagnose, I also tried writing it out in the yaml style just in case:
networks:
- name: incusbr0
type: bridge
config:
ipv4.address: 10.250.76.0
ipv4.nat.address: 10.250.76.10
ipv6.address: none
storage_pools:
- name: data
driver: dir
config:
source: ${secrets.lxcStore}
profiles:
- name: default
devices:
root:
path: /
pool: data
type: disk
eth0:
name: eth0
network: incusbr0
type: nic
This also failed to parse.
Error: yaml: unmarshal errors:
line 15: cannot unmarshal !!map into string
TL; DR
Two problems:
- Can’t find the external address to log into the container (probably super straighforward but I’m stuck anyways)
- Can’t configure profiles in my preseed.yaml due to parsing errors.
My environment is entirely configured using NixOS, so I can also include the full reproducible nix setup if you think it would help.
Incus version 6.0.3.