Bug or misuse? qubesd service crashed: Can't set template to non-existing qube default-dvm

I’d like to know if I’ve done something silly or if this is a bug.

What happens: qubesd crashes with the error message “Can't set template to non-existing qube default-dvm” after removing default-dvm from the GUI without any indication that anything is still pointing to it.

How to fix: On dom0, Delete the preloaded dispVms from /var/lib/qubes/qubes.xml and restart the system. (BACK UP THE FILE FIRST)

Steps to reproduce:

On a fresh Qubes installation, I wanted to rename default-dvm to adhere to my naming conventions.

  • Clone: I cloned default-dvm and made all Qubes point to the better named clone.
  • I tried deleting default-dvm but the GUI complained it is still in use.
  • I found out that it is still used in “Global Config > Disposables > Default disposable template”, and I changed that.
  • Delete: I deleted default-dvm, this time the GUI made no complaints.
  • Disable preloading: At some point, and I cannot recall if this was earlier or after the above changes, I UNCHECKED “preload disposables from default disposable template”.
  • System update & restart: I kept using the system with no issues until a new update was available in dom0. After applying the update I immediately restarted the computer.
  • qubesd fails to start: When I restarted, the launcher button was unresponsive and other buttons where missing. sudo systemctl status qubesd.service revealed the Qubes daemon is dead. The journalctl log was: qubes.exc.QubesPropertyValueError: Can't set template to non-existing qube default-dvm

Fix: Checking /var/lib/qubes/qubes.xml revealed there were two disposable VMs referring to default-dvm. Deleting the two <domain> xml blocks and restarting the system resolved the issue.

What were the two VMs? Created by you or by default?

They were two disposable VMs that I had not created. I suspect it has to do with the preloaded VMs feature, since the default setting is “2”. They were “dom7” and “dom8”. If I remember correctly their name was “disp” followed by a few digits.

Unfortunately I did not backup the XML before removing the VMs so I don’t have them to share (don’t do this! always backup sensitive files before touching them)