I'm using multipass to setup an Ubuntu virtual machine image. I'd like to make the installation of apt packages repeatable. Is it possible to script this somehow?
Asked
Active
Viewed 454 times
2
-
Yes it possible using `multipass exec …` – NikzJon Aug 13 '21 at 05:58
1 Answers
2
You could create a cloud-config file and add it via --cloud-init option when launching a fresh VM. Cloud init lets you provision a VM on almost any cloud provider, it's a very versatile tool. That way you can add any package you want, create news users, run bash commands etc. . More on cloud-config files here.
You then run a cloud-config file with:
multipass launch -n your_vm_name --cloud-init path/to/cloudconfig/file.yaml

friderik
- 117
- 2
- 12