How to launch a simple ubuntu VM you can `fly ssh console` into

I needed this to do some work outside my machine and I wanted an ubuntu I could fly ssh console into so all you need is:

  1. Create a fly.toml:
[build]
image = "ubuntu:24.04"

[experimental]
cmd = [ "sleep", "infinity" ]

[[vm]]
persist_rootfs = "always"
size = "performance-1x"
  1. Edit machine size as you see fit

  2. fly launch --copy-config --ha=false

I’ve chose to persist_rootfs just basic stuff I install is persisted like apt intall foobar. If I’d have big projects I’d use a volume too but that’s not my case. Stop the machine when not using so you pay less.

That’s it. Happy hacking.

3 Likes