This seems like a pretty silly question as it's too simple.
but
Just getting feet wet with multipass, so one of the first things I try is using a cloud init file. But multipass reports error: No such file:
[opt/multipass] $ multipass launch -n test --cloud-init setup.yaml
error: No such file: setup.yaml
so I tried ./setup.yaml
and absolute path /opt/multipass/setup.yaml
all give same no such file error.
/opt/multipass
drwxrwsr-x+ 2 david users 4096 Feb 6 08:04 ./
drwxrwsr-x+ 44 sysadmin users 4096 Feb 6 07:24 ../
-rw-rw-r--+ 1 david users 256 Feb 6 07:50 setup.yaml
What am I missing here? all the examples look like this. https://ubuntu.com/blog/using-cloud-init-with-multipass Does it give this error if there is an issue in the yaml file? Do the yaml files need to be in a particular directory? or have particular owner, permissions (it's read for everyone now). This seems so simple..should just work no?
setup.yaml
users:
- default
- name: ubuntu
- sudo: ALL=(ALL) NOPASSWD:ALL
plain_text_passwd: 'ubuntu'
home: /home/ubuntu
shell: /bin/bash
lock_passwd: false
gecos: Ubuntu
groups: [adm, audio, cdrom, dialout, floppy, video, plugdev, dip, netdev, sudo]
well the question was not totally silly as the issue comes because snaps don't have necessarily access to the host filesystem and multipass is a snap application.
By default though when you install multipass it does get access to the user home directory so when looking for clould init files it has to be relative to your home directory and I had the yaml files in
/opt/multipass
and multipass can't "see" there by default.So moving the yaml file to
~/multipass/setup.yaml
and then usingmultipass launch -n test --cloud-init ./multipass/setup.yaml
from home directory works.A bash script/function with an alias
alias mpl="multipass_launch"
can make launching easynow launching with that cloud init file becomes
mpl test setup
if you want to keep files multipass can find elsewhere then use bindfs