Skip to content

[settings] Add configurable default image#4793

Open
Jotanune wants to merge 5 commits intocanonical:mainfrom
Jotanune:feature/default-image-setting
Open

[settings] Add configurable default image#4793
Jotanune wants to merge 5 commits intocanonical:mainfrom
Jotanune:feature/default-image-setting

Conversation

@Jotanune
Copy link
Copy Markdown

@Jotanune Jotanune commented Apr 6, 2026

Closes #2653

Summary

Add a new local.default-image setting that allows users to configure which image is launched by default when no image is specified in multipass launch.

Problem

Currently, multipass launch without an image argument always defaults to the latest Ubuntu LTS (via the hardcoded "default" alias). There is no way to change this behavior.

Solution

  • Declare a new local.default-image setting key in constants.h
  • Register it as a BasicSettingSpec with an empty default value in the daemon
  • Read the setting in query_from() and make_cloud_init_vendor_config() to use the configured image when no image is specified in a launch request
  • Fall back to "default" (latest LTS) when the setting is empty

Usage

multipass set local.default-image=22.04
multipass launch          # launches 22.04 instead of the latest LTS
multipass launch 24.04    # explicit image still takes precedence
multipass set local.default-image=   # reset to default behavior

Testing

  • Updated daemonRegistersPersistentHandlerForDaemonSettings to verify the new setting is registered with an empty default value
  • All 16 TestGlobalSettingsHandlers tests pass

Jotanune added 5 commits April 6, 2026 17:21
Without this explicit dependency, vcpkg attempts to build gRPC before OpenSSL on Windows, causing the build to fail if OpenSSL is not installed system-wide.
Read the configured default image from the local.default-image
setting when no image is specified in a launch request. Falls
back to default (latest LTS) when the setting is empty.
@Jotanune
Copy link
Copy Markdown
Author

Jotanune commented Apr 6, 2026

This PR currently includes the commit from my other PR (#4792) because I needed that fix to be able to compile and test this feature locally on Windows. Once #4792 is merged into main, GitHub will automatically hide that commit from this PR. I can also rebase if you prefer.

@Jotanune Jotanune marked this pull request as ready for review April 6, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supports setting the default image?

1 participant