Page MenuHomeVyOS Platform

config.boot.default path inconsistency between cloud-init and build system causes flavor-defined configs to be ignored
Open, HighPublicBUG

Description

Summary

There is a path mismatch between where cloud-init looks for the default configuration file and where the build system places flavor-defined configurations. This causes custom config.boot.default files defined in release-flavors to be ignored on cloud/VM images.

The Problem

Cloud-init (cc_vyos.py and cc_vyos_userdata.py) uses this fallback path:

/usr/share/vyos/config.boot.default

The build system places flavor-defined configs at:

/opt/vyatta/etc/config.boot.default

When cloud-init runs on first boot and no /opt/vyatta/etc/config/config.boot exists yet (common for qcow2/raw images), it falls back to /usr/share/vyos/config.boot.default - completely bypassing the flavor-specific configuration.

Why We Cannot Simply Change Cloud-init

Changing cloud-init to use /opt/vyatta/etc/config. boot.default would break image flavors that do not define a custom config. These flavors rely on the vyos-1x package default at /usr/share/vyos/config.boot.default as their fallback.

Proposed Solution

The build system can place flavor-defined default_config at both locations:

  • /opt/vyatta/etc/config.boot.default (for vyos-router init script)
  • /usr/share/vyos/config.boot.default (for cloud-init)

Or it can create a final /opt/vyatta/etc/config/config.boot file.

This ensures:

  1. Flavors with custom configs have them available to cloud-init
  2. Flavors without custom configs still fall back to the vyos-1x package default
  3. The vyos-router init script continues to work as expected
Impacted Flavors

All cloud/VM flavors that define custom configs without the default vyos user.

Details

Version
2026.01.15-0020-rolling, circinus
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

There is a straightforward solution here, which requires adjusting the image flavor build tools to respect the changes of https://vyos.dev/T6006, which resolved long-standing issues of migration and config initialization.
In short, after T6006:

  • the file /usr/share/vyos/config.boot.defult is the build-time source of truth --- the flavor build system should install any flavor-defined config.boot.default at that location
  • both /opt/vyatta/etc/config.boot.default and /opt/vyatta/etc/config/config.boot are installed on first boot, at different stages of gathering system-specific information in vyos-router (component version information, respectively, migration and activation updates)

No file should be installed at /opt/vyatta/etc/config.boot.default at build time.

Fixing this inconsistency in the flavor build build system resolves two issues (1) cloud-init will have access to the correct flavor-specific default config (2) the flavor build system will not circumvent the improvements of T6006 by potentially calling full migration when unneeded.

The fix requires two parts, as the flavor build system will process a default config in two ways: (1) as the entry of the [default_config] option in the flavor.toml file (2) as an entry under [[includes_chroot]].
The fix for (1) is a one line change in the vyos-build/scripts/image-build/build-vyos-image; the fix for (2) recommends updating all flavor files containing a default config for the correct path entry; however, a workaround to modify the path from within the build-vyos-image script will be provided in the interim.