Preconfigure ubuntu-core image that does not require store account login on first boot

How to preconfigure a ubuntu-core image that runs a snap after the boot without further user interactions? The guide on Ubuntu Core Images seems to require a login with the snap store credentials on the first boot:

1 Like

I’ve built images roughly following that guide, and when booting from them they do not appear to require store credentials. Credentials are also not required for keeping the pre-installed snaps up-to-date with the store, etc. It’s similar to fact that you can download and install snaps on your desktop without logging into the store (at least from CLI).

All that said, I do think that by default, on first boot the image will prompt you for credentials as part of the normal initialization process. But there’s no real requirement to actually enter these in order for things to run. Note that in my case I’m always running headless, so nobody sees the prompts anyway. See this thread for bit more on this, and the options you have for pre-configuration: How to preconfigure custom image?


I think that if the snap you are interested in has a service, that service should be started automatically whether or not a user gets configured/installed. However note that you will need to follow @svet’s post if you need to have network connectivity for the image.

You can add snaps to an image when building it by using the required-snaps key in the model.json, or by using ubuntu-image's --extra-snaps option.