Page MenuHomeVyOS Platform

Encrypting updated image config overwrites existing TPM key
Closed, ResolvedPublicBUG

Description

Updating system image (via add system image command) copies over the config from the current image with encrypted config.
There is no encryption enabled in the updated image, so enabling the same overwrites the key stored in the TPM. It causes encrypted config load to fail when switching to the previous system image:

Loading the previous image after enabling encryption in the latest image:

[  104.449960] vyos-router[874]: Mounting VyOS Config...done.
[  123.259602] vyos-router[1290]: No key available with this passphrase.
[  123.298193] vyos-router[874]: ERROR: Failed to decrypt config volume.

Loading the previous image after enabling and then disabling encryption in the latest image:

[  133.687194] vyos-router[874]: Mounting VyOS Config...done.
[  138.797179] vyos-router[874]: ERROR: Failed to fetch encryption key from TPM. Encrypted config volume has not been mounted

So the current behaviour is as described above, however it could be that updating system image should fully migrate the existing encryption but not just copying the config contents to the new image. In this case the problem would be that existing encryption is not migrated to the new image

Steps to reproduce:

  1. Enable encryption
  2. Update system image via add system image command
  3. Enable encryption in the updated image
  4. Load previous image

Details

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

Event Timeline

Unknown Object (User) triaged this task as High priority.Aug 18 2025, 7:35 AM
Unknown Object (User) assigned this task to sarthurdev.Aug 18 2025, 7:40 AM
sarthurdev changed the task status from Open to In progress.Aug 18 2025, 8:03 PM
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.