How to change the template for a usb qube?

So I saw that the fedora 39 template needs to be updated so I installed the 40 template and then tried to change all the qubes that use the 39 template to 40, that worked for all except the usb qube. The default-dvm qube is using the fed39 template and the sys-usb qube is using the default-dvm qube.

What i can’t figure out is, since all my peripherals (keyboard/mouse) are usb I can’t shutdown the sys-usb qube so i can change the default template without disabling my mouse/keyboard (I don’t think?). I can’t be the first person to run into this but I wasnt able to find a post about it?

Help?

You could group commands together. But you should be careful to type the correct commands.

For example typing this in dom0:

qvm-shutdown sys-usb --wait;qvm-prefs default-dvm template fedora-40-xfce;qvm-start sys-usb
4 Likes

Thank you for that!
So, what you wrote worked - the caveat seems to be that my sys-usb qube is (as far as i can tell) randomly crashing (3 times in the past 2 hours). It seems that it doesn’t like the Fed40 template which is ok as I wanted to use a debian minmal dvm.
So I created default-dvm-minimal but wanted to make sure I understood what you wrote before trying to switch things over. The first and last parts/commands I understood but with qvm-prefs I am less sure:

qvm-prefs default-dvm template fedora-40-xfce

I was going to run

qvm-prefs sys-usb template default-dvm-minimal

but it occurred to me that might bork things. I don’t want debian-12-minimal to be the default dvm for the whole system, just for three sys- qubes (firewall, net and usb).

Is it as “simple” as going into the setting for the 3 sys- qubes → advance → default disposable template?

Default dvm for the whole system is not set by qvm-prefs. It is set by qubes-prefs

qubes-prefs modifies preferences for dom0 and some of the preferences of the whole system
qvm-prefs modifies preferences for AppVM, TemplateVM, StandaloneVM qubes.

ok, so qvm-prefs I guess is on the right track, so

qvm-shutdown sys-usb --wait;qvm-prefs sys-usb template default-dvm-minimal;qvm-start sys-usb

should shut down the sys-usb qube, change the template its based on to default-dvm-minimal, and then restart the sys-usb qube?

Yes. Exactly.

1 Like

Thank you!!!

1 Like

I keep meaning to add this to the FAQ, as it has come up many times.
It is always safer and better to test before committing such a change:

#!/usr/bin/bash
qvm-shutdown sys-usb --wait
qvm-prefs sys-usb template default-dvm-minimal
qvm-start sys-usb
sleep 180
qvm-shutdown sys-usb --wait
qvm-prefs sys-usb template OLD_DVM_TEMPLATE
qvm-start sys-usb`

If you do this, then you are set if there’s anything wrong with the
change, as the system will revert to your previous setting. If all works
well, just comment out the last 4 lines and run the script again.

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

3 Likes