Custom image build error using --disable-console-conf

I am in the process of creating a custom image of Ubuntu Core, whose installation process can be done unattended.

Following this post Ubuntu core image with pre configured login, I have prepared my custom auto-import.assert file that I use for user creation. To test this, I started by creating a custom image and trying to disable the console-conf.

However, I get the following error message:

Error: Error preparing image: cannot support with UC20+ model requested customizations: console-conf disable

Upon further research, I found this link https://bugs.launchpad.net/ubuntu-image/+bug/1875431

It appears that this feature has been disabled for UC20 (seeded) Model Assertions.

I wonder if there is a workaround I can apply to achieve what I need.

Okay, I figured it out myself. I am just leaving some notes here that might be useful to someone else.

Basically, --disable-console-conf is not necessary. The only important thing is that the custom image and the auto-import.assert file must either be signed with the same key as the model definition.

The following configuration worked for me.

Model assertion

{
    "type": "model",
    "series": "16",
    "authority-id": "<MY_ID>",
    "brand-id": "<MY_ID>",
    "model": "ubuntu-core-22-amd64",
    "architecture": "amd64",
    "timestamp": "2023-10-18T09:34:16+00:00",
    "base": "core22",
    "grade": "dangerous",
    "snaps": [
        {
            "name": "pc",
            "type": "gadget",
            "default-channel": "22/stable",
            "id": "UqFziVZDHLSyO3TqSWgNBoAdHbLI4dAH"
        },
        {
            "name": "pc-kernel",
            "type": "kernel",
            "default-channel": "22/stable",
            "id": "pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza"
        },
        {
            "name": "core22",
            "type": "base",
            "default-channel": "latest/stable",
            "id": "amcUKQILKXHHTlmSa7NMdnXSx02dNeeT"
        },
        {
            "name": "snapd",
            "type": "snapd",
            "default-channel": "latest/stable",
            "id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4"
        }
    ]
}

System-user assertion

{
    "type": "system-user",
    "authority-id": "<MY_ID>",
    "series": [
        "16"
    ],
    "brand-id": "<MY_ID>",
    "email": "my-ubuntu-one@gmail.com",
    "models": [
        "ubuntu-core-22-amd64"
    ],
    "name": "drcoccodrillus",
    "username": "drcoccodrillus",
    "password": "$6$7V0doDdrf7O7UHLU$qLsPkmfdifQ5w2PNzhwzGrerhhdGZN.uBch1Y6u8Crz2yoIbHdDKI1oghl.iUVrA1P5jc6xqR58qHjINrRw8e0",
    "since": "2023-01-01T18:00:00+00:00",
    "until": "2099-12-31T18:00:00+00:00"
}
1 Like