Change default-dvm from Fedora 38 to Fedora 39

Hello,
new template Fedora 39 successfully downloaded and already replaced the old Fedora 38 templates in 39.

Now the problem. Now I want to change the last template, the default dvm from fedora 38 to fedora 39. would work if it wasn’t for the sys-usb. Because I would have to switch it off to be able to change the template. Well, if I shut it down I can’t do anything anymore, because my mouse and keyboard are attached to it.

Any ideas?

The command (in dom0 terminal) is:

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

But best way is, you clone your default-dvm to a default-fedora-39-dvm and then insert:

qvm-shutdown --wait sys-usb; qvm-prefs -s sys-usb template default-fedora-39-dvm; qvm-start sys-usb

…and so on the next time
fedora-40
fedora-41

The command stops sys-usb // change the template // starts sys-usb again. You don’t have to do anything with keyboard and mouse during this…

5 seconds of fear!

2 Likes

okay, it worked, thanks

potentially followed by disaster.
I always recommend a failsafe:

#!/usr/bin/bash

qvm-shutdown --wait sys-usb
sleep 10
qvm-prefs sys-usb template <NEW_TEMPLATE>
qvm-start sys-usb

## Delete this section after testing
sleep 120
qvm-shutdown sys-usb
sleep 10
qvm-prefs sys-usb template <OLD_TEMPLATE>
sleep 5
qvm-start sys-usb
## Delete this section after testing

That gives you 2 minutes to test out the new template backed sys-usb,
and will then revert to the old.
Once you are happy you can delete, or comment out, the testing section, and
rerun the script to make the change permanent.

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

Okay, thanks.
Does this text have to be in the #!/usr/bin/bash ?
and then execute it?
Or just write it in the terminal from Dom0 one after the other?

I’m just making a documentation for next time.

You have to write unmans text into a file, which you can execute (i.e. change-sys-usb-template.sh) and store wherever you want.

This is already documented here:

https://www.qubes-os.org/doc/templates/#switching

Perhaps you should update the documentation above and/or upstream your script into Qubes.

2 Likes

I’m looking for an option that is similar because Qubes is my daily driver on my desktop and I am picky about my keyboard. I really like this type of solution because it is the creation of an editable script that could progress with the system.

Here is my process when I tested it today:
Saved the text as <filename> .
Used chmod -x <filename> in a terminal window in the correct directory to make it executable.
Had to bash <filename> for it to run.

I got the following errors:

qvm-shutdown: command not found
qvm-prefs: command not found
qvm-start: command not found

Here is where I could use some clarification in the process:
It makes sense that these commands can only be run from dom0. Is that a correct assumption?

I read how to move a file to dom0 in unman’s post.

or I know that I could write using an editor like vim in a dom0 terminal. Is there a gui text editor equivalent in dom0?

or could I somehow ask dom0 to execute a file in a vm but it run in dom0?

What would the best practice be for security? (Outside of buying a ps2 keyboard or reinstalling when a new qubes image is available, of course?)

chmod - removes the mode bit
You want chmod +x

Yes

nano may suit you better than vi

1 Like

You are awesome! Thank you for the help.

I’m so glad that I did this as a practice with a script! I would have locked myself out again.

qvm-prefs: error: template for DispVM must have template_for_dispvms=True

Then tried in dom0 terminal
qvm-prefs --set fedora-39-dvm template_for_dispvms True (also tried with the ‘=’ included)

and got this error

qvm-prefs: error: no such property: ‘template_for_dispvms’

‘template_for_dispvms’ shows up under man qvm-prefs but not under qvm-prefs --help-properties fedora-39-dvm
Under the ‘–help-properties’ info I couldn’t find a similar property.

I’m at a loss of how to change it. Any idea what I missed?