Compose multipass™ virtual machines like a ... charm!
Multipass is a buggy and inconvenient project to manage virtual machines with Ubuntu.
So this project is now deprecated.
Think about using lima
/colima
instead which is more powerful and truly supported by community.
go install github.com/petr-korobeinikov/multipass-compose/cmd/multipass-compose@latest
-
Define your
multipass-compose.yaml
:services: web-server: image: focal database: image: focal backend: image: focal
-
Start machines up:
multipass-compose up
-
Check the status:
multipass-compose status
-
Do the job 🛠️ 🪚 🔨 🔧
-
Turn machines off:
multipass-compose down
multipass-compose up # Starts machines up
multipass-compose down # Turns machines down
multipass-compose status # Shows machines status
multipass-compose ip <name> # Shows IPv4 address of given machine
services: # Defines a list of services
lb: # Custom machine name
image: focal # Ubuntu release, see `multipass find`
cpus: 1 # Number of CPUs to allocate.
mem: 1G # Amount of memory to allocate. Positive integers, in bytes, or with K, M, G suffix.
disk: 5G # Disk space to allocate. Positive integers, in bytes, or with K, M, G suffix.
cloud-init: path/to/cloud/config.yaml # Path or URL to a user-data cloud-init configuration.
database:
image: focal
cpus: 4
mem: 4G
disk: 80G
backend:
image: focal
cpus: 2
mem: 2G
disk: 20G
A complete list of examples you can find out in this repo.
bats
helpers installed as git submodules. To fetch them out use:
git submodule update --init --recursive