2

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?

thinwybk
  • 4,193
  • 2
  • 40
  • 76

1 Answers1

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