Poor documentation

Not clear if I use --cloud-init if that adds to the default or overrides it - my experience suggests it overrides it.
Why is the file /etc/cloud/cloud.cfg not in yaml format as the docs suggest it MUST be?
Since it is NOT in yaml format how do I change or add to it? Specifically how do I add another user?

1 Like

Hi @istringer, you’re right we need a bit more documentation on the --cloud-init usage, we have a dedicated page planned for it.

Why do you say /etc/cloud/cloud.cfg is not YAML? In any case, that’s not where you want to add cloud metadata.

Have a look at upstream cloud-init documentation, but specifically for creating users this is the simplest use with Multipass:

$ mp launch --cloud-init - <<EOF
users:
- default
- name: ${USER}
  ssh_authorized_keys: 
  - $( cat ~/.ssh/id_rsa.pub )
EOF

Thanks for the speed reply.

So with a bit of digging in the source it appears the defaults for multipass are hardcoded.
I had mistakenly found /etc./cloud/cloud.cfg and assumed it was used as the defaults. I said it did not look YAML as it differs significantly from the examples shown on the cloud-init page (including NOT having the “#cloud-config” tag at the top of the file etc.

In your example what does the “- default” actually do?

I am also interested in using static IP’s if possible rather than relying on DHCP but again can not see clearly from the documents how that can be achieved…
I have tried adding a "network: section with an ethernet: defined but it appears to be ignored.

Thanks

It adds the default ubuntu user, which is necessary for Multipass to be able to access the instance.

The default, DHCP-based networking is also required for now for Multipass to function (we rely on finding the instance’s address out from the DHCP server).

We’re close to releasing a version of Multipass with bridging support, which means you can add a secondary interface and manage it how you like. You can find more information on the GitHub issue.