Skip to content

Instantly share code, notes, and snippets.

@jmsdnns
Created August 30, 2024 17:16
Show Gist options
  • Save jmsdnns/5ba4d73bd75f1ac9ab070452dec395f2 to your computer and use it in GitHub Desktop.
Save jmsdnns/5ba4d73bd75f1ac9ab070452dec395f2 to your computer and use it in GitHub Desktop.
A simple config for managing groups of VMs using lima and just
default:
just -l
lsvm:
limactl ls
mkvm id:
limactl create \
--name="{{id}}" \
--vm-type=vz \
--rosetta \
--mount-type=virtiofs \
--mount-writable \
--network=vzNAT \
--tty=false \
template://default
mkswarm name count:
for i in $(seq 1 {{count}}); do \
just mkvm {{name}}-$i; \
done
startswarm name:
for id in $(limactl list --format '{{{{.Name}}' | grep {{name}}); do \
limactl start $id; \
done
stopswarm name:
for id in $(limactl list --format '{{{{.Name}}' | grep {{name}}); do \
limactl stop $id; \
done
rmvm id:
limactl delete {{id}}
rmswarm name:
for id in $(limactl list --format '{{{{.Name}}' | grep {{name}}); do \
just rmvm $id; \
done
shellvm id:
eval $(limactl show-ssh --format=cmd "{{id}}" 2>/dev/null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment