New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

woes trying to update default dispvm to fedora-26 #3499

Closed
taradiddles opened this Issue Jan 27, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@taradiddles

taradiddles commented Jan 27, 2018

Apologies for the mixed bag of issues here - I thought it'd be better to list everything in one place instead of opening a few interrelated issues.

Qubes OS version:

4.0 RC3


Steps to reproduce the behavior:

I'm trying to update 4.0rc3's dvm from fedora-25 to fedora-26 and remove references to fedora-25-dvm. I tried to simply rename fedora-25-dvm to fedora-26-dvm from fedora-25-dvm's settings gui but got dependency errors, so reverted to cloning fedora-25-dvm to fedora-26-dvm and trying to change qubes's global dispvm default:

Steps:

  • cloned fedora-25-dvm to fedora-26-dvm
  • (side issue: fedora-26-dvm's app menu weren't shown as "disposable", so had to run qvm-appmenus --update fedora-26-dvm as per #3464)
  • Ques Global Settings' gui doesn't include an option (yet?) to change the default dispVM, so I set it with qubes-prefs default_dispvm fedora-26-dvm

Everything looked OK until I tried to remove the old f25 dispvm:

[user@dom0 ~]$ qvm-remove fedora-25-dvm
[...]
qubesadmin.exc.QubesException: Domain is in use: 'fedora-25-dvm'; details in system log

[user@dom0 ~]$ tail -1 /var/log/qubes/qubes.log 
2018-01-27 09:56:39,760 Cannot remove fedora-25-dvm, used by sys-usb.default_dispvm

[user@dom0 ~]$ qvm-prefs sys-usb | grep default_dispvm
default_dispvm        -  fedora-25-dvm
[user@dom0 ~]$ qvm-prefs vault | grep default_dispvm
default_dispvm        -  fedora-25-dvm
[...]

Expected behavior:

Supposedly, I should be able to remove fedora-25-dvm.

Actual behavior:

qubes-prefs default_dispvm fedora-26-dvm doesn't propagate the change like one should supposedly expect so VMs still use the old fedora-25-dvm.

Emphasize on the supposedly word here: 'Default (...)' is listed as default dispVM in the VM settings gui, but I don't see any 'use default dispvm' when listing prefs with qubes-prefs - eg. I don't see how qubes-prefs could automatically propagate the change (after all maybe I'd want to keep fedora-25-dvm for some of the VMs).

The worst part for unsuspecting users is that the VM's setting gui shows that the new fedora-26-dvm is used ('Default (fedora-26-dvm)') while qvm-prefs (and qubes.xml) shows that fedora-25-dvm is used.
I tried to set the dispvm in the VM settings gui to 'none', clicked OK, reopened the settings, set the dispvm to 'default (fedora-26-dvm)', clicked OK, but qvm-prefs still listed fedora-25-dvm as default_dispvm.

vm-adv-settings

[edit: added screenshot for clarity]

General notes:

Workaround 1: don't go through those complicated steps: simply set fedora-25-dvm's template to fedora-26. The name 'fedora-25-dvm' can't be changed and will be misleading but you'll know the template is fedora-26.

Workaround 2: do the steps above and then qvm-prefs vm-name default_dispvm fedora-26-dvm for each VM.


Related issues:

@QubedOne

This comment has been minimized.

Show comment
Hide comment
@QubedOne

QubedOne Jan 29, 2018

FWIW, the way I accomplished creating a fedora-26-dvm was by using salt to create a new vm based on the default-dispvm files, e.g.:

cp /srv/formulas/base/virtual-machines-formula/qvm/default-dispvm* /srv/salt/
(rename both files in /srv/salt/ to fedora-26-dvm.sls and fedora-26-dvm.top)
(change all instances of 25 with 26 in both files)
qubesctl top.enable fedora-26-dvm
qubesctl --all state.highstate

(reference: https://www.qubes-os.org/doc/salt/)

FWIW, the way I accomplished creating a fedora-26-dvm was by using salt to create a new vm based on the default-dispvm files, e.g.:

cp /srv/formulas/base/virtual-machines-formula/qvm/default-dispvm* /srv/salt/
(rename both files in /srv/salt/ to fedora-26-dvm.sls and fedora-26-dvm.top)
(change all instances of 25 with 26 in both files)
qubesctl top.enable fedora-26-dvm
qubesctl --all state.highstate

(reference: https://www.qubes-os.org/doc/salt/)

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 29, 2018

Member

There is easier way to do it with salt:

  1. Update qubes-mgmt-salt-dom0-virtual-machines package to the version in current-testing repository (4.0.10) - it contains settings for fedora-26-dvm
  2. call qubesctl state.sls qvm.default-dispvm
Member

marmarek commented Jan 29, 2018

There is easier way to do it with salt:

  1. Update qubes-mgmt-salt-dom0-virtual-machines package to the version in current-testing repository (4.0.10) - it contains settings for fedora-26-dvm
  2. call qubesctl state.sls qvm.default-dispvm
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 29, 2018

Member

Remaining, Qubes Manager related issues:

  • missing option in global settings
  • wrong default_dispvm displayed in VM settings
Member

marmarek commented Jan 29, 2018

Remaining, Qubes Manager related issues:

  • missing option in global settings
  • wrong default_dispvm displayed in VM settings

@conorsch conorsch referenced this issue in freedomofpress/securedrop-workstation Feb 4, 2018

Closed

Migrate to fedora 26 templates #48

@rysiekpl

This comment has been minimized.

Show comment
Hide comment
@rysiekpl

rysiekpl Mar 18, 2018

I am running QubesOS R4.0 rc5, upgraded all the way from rc2 (in case that matters). I went through steps specified here: https://www.qubes-os.org/doc/template/fedora/upgrade-25-to-26/

That is, I cloned fedora-25 template as fedora-26, upgraded that, created a fedora-26-dvm template based on that, and changed the default DispVM system-wide.

I sadly cannot seem to be able to remove the qubes-template-fedora-25 package. I made sure that the default_dispvm pref is properly set on all relevant VMs:

$ for vm in $( qvm-ls --all --raw-list --exclude whonix-ws-dvm ); do echo -n "+-- $vm: "; qvm-prefs --get $vm default_dispvm; done
+-- anon-whonix: fedora-26-dvm
+-- debian-9: fedora-26-dvm
+-- debian-gpg: fedora-26-dvm
+-- fedora-25: fedora-26-dvm
+-- fedora-25-dvm: fedora-26-dvm
+-- fedora-26: fedora-26-dvm
+-- fedora-26-dvm: fedora-26-dvm
+-- personal: fedora-26-dvm
+-- signal: fedora-26-dvm
+-- split-gpg2-test: fedora-26-dvm
+-- sys-firewall: fedora-26-dvm
+-- sys-net: fedora-26-dvm
+-- sys-usb: fedora-26-dvm
+-- sys-whonix: fedora-26-dvm
+-- untrusted: fedora-26-dvm
+-- vault: fedora-26-dvm
+-- whonix-gw: fedora-26-dvm
+-- whonix-ws: fedora-26-dvm

...but removing the package still throws an error (albeit a bit confusingly):

$ sudo dnf remove qubes-template-fedora-25
Dependencies resolved.
=============================================================================================================================================================================================================================================
 Package                                                            Arch                                             Version                                                       Repository                                           Size
=============================================================================================================================================================================================================================================
Removing:
 qubes-template-fedora-25                                           noarch                                           4.0.0-201710191729                                            @anaconda                                           4.6 G

Transaction Summary
=============================================================================================================================================================================================================================================
Remove  1 Package

Installed size: 4.6 G
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
usage: qvm-template-postprocess [-h] [--verbose] [--quiet] [--really]
                                [--skip-start] [--keep-source]
                                {post-install,pre-remove} name dir
qvm-template-postprocess: error: Qube fedora-25-dvm uses this template
error: %preun(qubes-template-fedora-25-4.0.0-201710191729.noarch) scriptlet failed, exit status 2
Error in PREUN scriptlet in rpm package qubes-template-fedora-25
Error in PREUN scriptlet in rpm package qubes-template-fedora-25
qubes-template-fedora-25-4.0.0-201710191729.noarch was supposed to be removed but is not!
  Verifying   : qubes-template-fedora-25-4.0.0-201710191729.noarch                                                                                                                                                                       1/1 

Removed:
  qubes-template-fedora-25.noarch 4.0.0-201710191729                                                                                                                                                                                         

Complete!

The VMs nor the package are not actually removed:

$ qvm-ls | grep fedora-25
fedora-25        Halted   TemplateVM  black   -           -
fedora-25-dvm    Halted   AppVM       red     fedora-25   sys-firewall
$ dnf list | grep fedora-25
qubes-template-fedora-25.noarch        4.0.0-201710191729     @anaconda         

rysiekpl commented Mar 18, 2018

I am running QubesOS R4.0 rc5, upgraded all the way from rc2 (in case that matters). I went through steps specified here: https://www.qubes-os.org/doc/template/fedora/upgrade-25-to-26/

That is, I cloned fedora-25 template as fedora-26, upgraded that, created a fedora-26-dvm template based on that, and changed the default DispVM system-wide.

I sadly cannot seem to be able to remove the qubes-template-fedora-25 package. I made sure that the default_dispvm pref is properly set on all relevant VMs:

$ for vm in $( qvm-ls --all --raw-list --exclude whonix-ws-dvm ); do echo -n "+-- $vm: "; qvm-prefs --get $vm default_dispvm; done
+-- anon-whonix: fedora-26-dvm
+-- debian-9: fedora-26-dvm
+-- debian-gpg: fedora-26-dvm
+-- fedora-25: fedora-26-dvm
+-- fedora-25-dvm: fedora-26-dvm
+-- fedora-26: fedora-26-dvm
+-- fedora-26-dvm: fedora-26-dvm
+-- personal: fedora-26-dvm
+-- signal: fedora-26-dvm
+-- split-gpg2-test: fedora-26-dvm
+-- sys-firewall: fedora-26-dvm
+-- sys-net: fedora-26-dvm
+-- sys-usb: fedora-26-dvm
+-- sys-whonix: fedora-26-dvm
+-- untrusted: fedora-26-dvm
+-- vault: fedora-26-dvm
+-- whonix-gw: fedora-26-dvm
+-- whonix-ws: fedora-26-dvm

...but removing the package still throws an error (albeit a bit confusingly):

$ sudo dnf remove qubes-template-fedora-25
Dependencies resolved.
=============================================================================================================================================================================================================================================
 Package                                                            Arch                                             Version                                                       Repository                                           Size
=============================================================================================================================================================================================================================================
Removing:
 qubes-template-fedora-25                                           noarch                                           4.0.0-201710191729                                            @anaconda                                           4.6 G

Transaction Summary
=============================================================================================================================================================================================================================================
Remove  1 Package

Installed size: 4.6 G
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
usage: qvm-template-postprocess [-h] [--verbose] [--quiet] [--really]
                                [--skip-start] [--keep-source]
                                {post-install,pre-remove} name dir
qvm-template-postprocess: error: Qube fedora-25-dvm uses this template
error: %preun(qubes-template-fedora-25-4.0.0-201710191729.noarch) scriptlet failed, exit status 2
Error in PREUN scriptlet in rpm package qubes-template-fedora-25
Error in PREUN scriptlet in rpm package qubes-template-fedora-25
qubes-template-fedora-25-4.0.0-201710191729.noarch was supposed to be removed but is not!
  Verifying   : qubes-template-fedora-25-4.0.0-201710191729.noarch                                                                                                                                                                       1/1 

Removed:
  qubes-template-fedora-25.noarch 4.0.0-201710191729                                                                                                                                                                                         

Complete!

The VMs nor the package are not actually removed:

$ qvm-ls | grep fedora-25
fedora-25        Halted   TemplateVM  black   -           -
fedora-25-dvm    Halted   AppVM       red     fedora-25   sys-firewall
$ dnf list | grep fedora-25
qubes-template-fedora-25.noarch        4.0.0-201710191729     @anaconda         
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment