Your submission was sent successfully! Close

Using cloud-init with Multipass

This article originally appeared on Joshua Powers’ blog

cloud-init + Multipass

Multipass is a quick and easy way to launch virtual machine instances running Ubuntu. Cloud-init is the standard for customizing cloud instances and now multipass can also make use of cloud-init to customize an instance during launch.

Below is an example of launching a new VM with cloud-init user-data:

multipass launch -n my-test-vm --cloud-init cloud-config.yaml

user-data Format

Currently multipass only supports YAML cloud-config files. Passing a script, a MIME archive, or any of the other user-data formats cloud-init supports will result in an error from the YAML syntax validator. Check out the cloud-init docs for examples of YAML cloud-config.

YAML Syntax Validation

Multipass will validate the YAML syntax of the cloud-config file before attempting to start the VM! A nice addition to help save time when experimenting with launching instances with various cloud-configs.


Multipass uses cloud-init to pass in vendor-data to setup the VM for access by the user. If the user overrides any of the required keys (e.g. packages, ssh_authorized_keys, users, etc.) in his or her user-data then multipass will merge its own data so that the end-user will not lose access to the system.

If interested, a user can examine the executed user-data and vendor-data by looking at the files in /var/lib/cloud/instances/.

Got Questions?

As always, you can chat with the cloud-init developers in #cloud-init on Freenode or email the cloud-init mailing list.

The multipass team is also on Freenode at #multipass and to view the code and report bugs check them out on GitHub.

Ubuntu cloud

Ubuntu offers all the training, software infrastructure, tools, services and support you need for your public and private clouds.

Newsletter signup

Select topics you're
interested in

In submitting this form, I confirm that I have read and agree to Canonical's Privacy Notice and Privacy Policy.

Related posts

Single-command Docker environments on any machine with Multipass

Multipass has a new workflow tailored to run Docker containers on macOS, Windows or Linux. One single command, no dependencies, full flexibility. Multipass...

How-To: Docker on Windows and Mac with Multipass

Update: there is now a more streamlined way to run Docker on Multipass – see this tutorial for more details. Original blog below: If you’re looking for an...

How to run ECS Anywhere workloads using Ubuntu on any infrastructure

Using Ubuntu for your ECS clusters on-prem or elsewhere will allow you to run your ECS Anywhere workloads with optimal performance everywhere you need it.