Immortal qube keeps resurrecting itself

I’ve seen this several times. You select “shutdown” for a qube, watch it shut down, then immediately you get a notification that the qube is starting again.

It seems to be when qrexec has something queued up

For example something was wrong with sys-gui-vnc, and typing:
qvm-run --pass-io sys-gui-vnc ls
just hangs (because i forgot the --no-gui parameter). In a attempt to fix it, I tried selecting the shutdown option from “qubes domains” gui widget and shut sys-gui-vnc down. it started right back up. I tried shutting it down, and it came back up 6 times in a row. I’m assuming that trying it a 7th or 8th time wont help anything, and that i’ll need to shut down the whole system (I.E. dom0)

My guess is that the qvm-run --pass-io sys-gui-vnc ls command didn’t work the previous time, then it realizes that the qube is stopped, so it starts the qube as if i had just issued the command. Then after sys-gui-vnc is started, it tries it again and the same problem of it not responding to qrexec is happening,

Anyone have any ideas if that’s what’s actually going on?

I think you’re right about your assumptions. You can see the qvm-run commands queued in dom0, e.g. via `ps-aux|grep qvm-run’.
Probably qvm-run should have a timeout after which it stops waiting for a VM to start.

I wonder what would happen if you were to delete the qube? You’d have to do that in the split instant before it restarts.

(Clone it first so you have a copy.)

Or, alternatively, it should consider the command “done” once the qube has started once.

I do recall seeing qubes restart unexpectedly lately, particularly when I “kill” them after they hang for whatever reason, and that may be this same issue.