What to do if qubes os fails to kill a qube

More of an open discussion than a guide, but might be useful for people searching for help later on.

When qubes fails to shut down a qube with an error like this:

The following error occurred while attempting to shut down qube qube_name:
Got empty response from qubesd. See journalctl in dom0 for details.

Or like this, if using qvm-shutdown --wait --timeout:

qvm-shutdown: error: Failed to shut down: qube_name

I solve it by asking daddy libvirt to clean up the mess (somewhat ironic considering that qubes throws libvirtError in journalctl):

sudo virsh destroy qube_name

Which leads to the qube being registered as down after hanging for a second in the qube list applet. Just be careful with this command, it is “the equivalent of ripping the power cord out” for the guest.

I did it a couple of times so far, and I see no consequences to my actions. Please correct me if it has any implications.

1 Like

I think it’s ok, as a last resort. Aslo, I always supposed that the “Kill” action available in the graphical “Qube Manager”/qui uses virsh to achieve that (probably using the same command-line that you wrote).

1 Like

It may be so, but kill action is not available in the applet (I haven’t checked the manager) if a qube gets stuck like that. Applet won’t respond until the qube fails to shut down.

It is a good point since you should be able to kill a qube after pausing it, but I suspect that trying to pause such a qube may fail as well.

1 Like

Yes, “Kill” is not present the applet, but is available if you right-click on a running qube in the full GUI (Qube Manager).

1 Like

What about just using qvm-kill DOMAIN?

1 Like

I never tried it because I have failed to notice it in the autocompletion output :sweat_smile:

1 Like

Among many aliases, I have qk=qvm-kill, and a shortcut to effect the
same. No consequences seen (as yet).

I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.

1 Like

qvm-kill ultimately uses this:

 try:
            self.libvirt_domain.destroy()

… so yeah… same as using virtsh to destroy. :slight_smile:

1 Like

If you exclude everything else that kill() does, such as checking for qube state, waiting for a correct state for the thing to be managed by qubesd, yes, it is the same.

Don’t use virsh commands, prefer the qvm-* alternatives when possible.

2 Likes