[solved] kali-template shuts down after accidentally removing qubes-packages

My last apt update && apt dist-upgrade killed my kali-template, very probably because I didn’t put qubes-vm-dependencies on “hold”.

Anyway, it looks like

open console in qube (GUI Qube Manager)
qvm-console-disvpm kali (dom0 CLI)

gives me access to my kali-template, but an

apt install qubes-vm-dependencies

returns I should

dpkg --configure -a

and the later crashes the running template.

The error cannot connect to qrexec agent for 60 seconds reported by dom0 suggests I’m on the right path, however can somebody suggest how to get the emergency console more stable?

update: the running template probably crashes 60 seconds after starting the vm, so that might be some systemd-service not be able to start… dpkg is not to blame.

You can connect to your VM console from dom0:
sudo xl console yourvmname
Also the Kali updates seems to be broken because of dependency problem with Qubes packages:

Thank you, yes, sudo xl console kali is similiar to qvm-console-disvpm kali, however the kali template-VM keeps on powering down after a short period of time.

If I got a stable running VM and a terminal within I might be able to return to the last kali-snapshot or rolling back the removal of qubes-gui-agent. Otherwise I might just have to setup a new template as described by @unman:

There should be at least some errors reported in console. Do you see anything failing there?
Maybe your root partition is full? I think I had something similar when I had not enough space to install updates and I couldn’t boot it afterwards before extending partition and repairing filesystem.

Nope, only 20 GB of 64 GB are in use.

less /var/log/xen/console/guest-kali.log doesn’t give me helpfull clues. Last lines state:

[timestamp] Starting Record Runlevel Change in UTMP.
[timestamp] Finished Record Runlevel Change in UTMO.
[timestamp] fbcon: Taking over console
[timestamp]
[timestamp] Kali GNU/Linux Rolling localhost.localdomain hvc0
[timestamp]
[timestamp] localhost login:

The logfile basically displays the booting process and starting systemd services.

[timestamp] Failed to start Qubes remote exec agent
[timestamp] See ‘systemctl status qubes-qrexec-agent.service’ for details.

That is obviously part of the problem.

Unfortunatly no hint on what keeps powering down the VM.

So far google found those article for me:

https://bugs.xenserver.org/browse/XSO-246

It might be less time consuming to setup a new template-VM. Unless there is something to learn here, like why and how VMs are powered down by Qubes Xen setup…

I guess you VM is being shutdown because of qrexec_timeout. Increase its value in dom0 and see if it’ll last longer:
qvm-prefs kali qrexec_timeout 3600

1 Like

It does. Thanks for your help!