Lxd start vm wait?

is there a way to know when the lxd agent is ready in a vm?

I am trying to script vm startups and running an exec after the vm has started and I get the error that the agent isnt running if I try to connect too soon.

Error: LXD VM agent isn’t currently running

is there a way to have the lxc client detect or wait for the agent to be available?

maybe a lxd start --wait type option?

No, there isn’t as LXD itself doesn’t actually know.
A cheaper way to check would be to periodically check lxc info NAME and look for something like the Processes count as that will show -1 until the data can be retrieved from the agent.

Perhaps lxd can make a --wait option by utilizing this lxd info trick?