Qvm-template command line error

Hello,

I have the following error :

[user@dom0 ~]$ qvm-template info
[Qrexec] /usr/lib/qubes/qvm-template-repo-query: line 40: dnf: command not found
ERROR: qrexec call 'qubes.TemplateSearch' failed.
[user@dom0 ~]$ sudo qvm-template info
[Qrexec] /usr/lib/qubes/qvm-template-repo-query: line 40: dnf: command not found
ERROR: qrexec call 'qubes.TemplateSearch' failed.
[user@dom0 ~]$ sudo qvm-template list -v
[Qrexec] /usr/lib/qubes/qvm-template-repo-query: line 40: dnf: command not found
ERROR: qrexec call 'qubes.TemplateSearch' failed.
2021-06-03 19:44:54,417 [MainProcess qvm_template.main:1544] app: qrexec call 'qubes.TemplateSearch' failed.
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template.py", line 1527, in main
    list_templates(p_args, app, 'list')
  File "/usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template.py", line 1177, in list_templates
    query_res = qrexec_repoquery(args, app)
  File "/usr/lib/python3.8/site-packages/qubesadmin/tools/qvm_template.py", line 490, in qrexec_repoquery
    raise ConnectionError("qrexec call 'qubes.TemplateSearch' failed.")
ConnectionError: qrexec call 'qubes.TemplateSearch' failed

I’m getting this too. I’m on the unstable branch of 4.1.

I only started looking for it once it started happening to me. Sorry…:frowning:

My guess is there’s a mismatch in the Python libraries or qrexec (although I could be horribly wrong)…

If you’re looking to remove old versions of templates (for example, replacing Whonix 15 that came installed with Qubes 4.1 beta with Whonix 16, like I just did last week), you’ve got several options, depending on how well you know what you’re doing:

  1. Upgrade the template inside the actual template - Requires a lot of patience and knowledge about how Qubes works
    Treat the template like an independent machine and upgrade it like you would bare metal.
    More info:
    How to upgrade a Fedora template in-place | Qubes OS
    How to upgrade a Debian template in-place | Qubes OS

  2. Remove template and replace with downloaded RPM - A little hacky, but less chance for things to go wrong
    Info on removing templates that were installed when you first installed Qubes OS:
    How to Remove VMs Manually | Qubes OS

You can go to ftp.qubes-os.org in a Qube and downloading the .rpm (based on your version and desired branch), and then passing it into dom0 by typing this command into a dom0 terminal (Qubes Menu > Terminals Emulator [second item in the menu]):

qvm-run --pass-io <name_of_qube_you_used> 'cat /path/to/rpm-file/you-just-downloaded' >  /path/in-dom0/where-you-want/rpm-file saved

and then:

sudo rpm -U /path/in-dom0/to-rpm-file

More info here: How to copy from dom0 | Qubes OS

  1. Wait for an update to qvm-template-repo-query to be pushed that fixes this - Easiest option, but you’re potentially a ‘sitting duck’ if you use templates that are past EOL

Hope this helps :slight_smile:

1 Like

Obviously, don’t put anything in dom0 that you don’t trust.

Dom0 programs can see into VMs, take things from them, add things to them, run commands, and essentially have a “green light” on your entire machine (and anything it’s connected too as well).

But I’m sure I didn’t need to tell you this :wink:

1 Like