Skip to content
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

Upgrades all sys-* VMs to Fedora 30 #331

Merged
merged 4 commits into from
Nov 13, 2019

Conversation

conorsch
Copy link
Contributor

Implements unattended updates to the built-in Qubes sys-* VMs, specifically:

  • sys-net
  • sys-firewall
  • sys-usb

If the VMs are not running the latest version, they will briefly be halted to change the template setting, then restarted on the new template.

Updates the default DispVM template to be sd-svs-disp. Enabling this as the default means that qvm-open-in-dvm <file> from any VM will result in sd-svs-disp being used.

Improves the dom0 RPM repo logic to be persistent across reboots. Doing so was required in order to get the tests passing after the template update specifically for sys-firewall.

Addresses changes specified in a few different issues; thus:

Testing

In order to test, first confirm that your environment is not what's enforced by this PR. Specifically, your system should be configured as follows:

[user@dom0 ~]$ qvm-prefs sys-net template
fedora-29
[user@dom0 ~]$ qvm-prefs sys-firewall template
fedora-29
[user@dom0 ~]$ qvm-prefs sys-usb template
fedora-29
[user@dom0 ~]$ qubes-prefs default_template
fedora-29
[user@dom0 ~]$ qubes-prefs default_dispvm
fedora-29-dvm

The above shows the pre-merge "correct" settings, namely F29 rather than F30 throughout.
If you already have a prior version of the SDW config provisioned, do not run make clean.
Instead, simply run make all, which will confirm that the VMs are updated in-place despite
a pre-existing config.

Afterwards, the output of the above commands should be:

[user@dom0 ~]$ qvm-prefs sys-net template
fedora-30
[user@dom0 ~]$ qvm-prefs sys-firewall template
fedora-30
[user@dom0 ~]$ qvm-prefs sys-usb template
fedora-30
[user@dom0 ~]$ qubes-prefs default_template
fedora-30
[user@dom0 ~]$ qubes-prefs default_dispvm
sd-svs-disp

As always, ensure that make test passes without error. New tests have been added to verify
the above settings; the example commands are provided for clarity.

Succinct checklist for testing:

  • make all shows no errors
  • make test show no errors
  • all sys-* VMs running fedora-30
  • start/restart an AppVM, confirm qvm-open-in-dvm <file> opens in an SDW netless VM

Conor Schaefer added 3 commits November 12, 2019 15:00
F29 is approaching EOL [0], so it's time to bump to F30.
These changes are most important for the `sys-*` VMs, such as
`sys-firewall`.

[0] https://fedoraproject.org/wiki/End_of_life
Previously, we weren't explicitly declaring the default DispVM template
at all. On fresh installs of 4.0.1, it'll be fedora-29, but over time,
as Fedora versions lapse into EOL, users/admins must manually update the
setting. That's no good. Rather than bump to the latest version of
Fedora (F30 as of this writing), let's use the SDW disp template, since
that includes no network, minimizing the possibility of
misconfigurations in the SDW workflows.
Allows unattended-upgrades of the Fedora-based sys-{firewall,net,usb}
AppVMs. It's somewhat of a harsh approach to `qvm-kill` the VMs while
they're running, but doing so appears to be our only option, given that:

  1. It's critical these VMs stay up-to-date (to receive patches)
  2. It's not possible to modify template settings for running VMs
  3. `qvm-shutdown` won't work on netvms with attachd hosts (hence
     `qvm-kill`)

Once the configuration is applied, killing each VM once, the new
template will be used. Then we'll have to do it again in about six
months, due to Fedora release cycle.
The RPM repo pubkey must exist in sys-firewall, in order for
`qubes-dom0-update` to pull in packages. We were previously adding the
pubkey to sys-firewall in a temporary manner; now the pubkey persists
across reboots.
@conorsch conorsch force-pushed the 262-upgrade-sys-vms-to-fedora-30 branch from 729e1c8 to 1bd0d2e Compare November 13, 2019 02:18
Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • make all shows no errors
  • make test show no errors (did not test, it made my system unusable in between)
  • all sys-* VMs running fedora-30
  • start/restart an AppVM, confirm qvm-open-in-dvm <file> opens in an SDW netless VM

Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed testing per the test plan, and did a visual review, looks great !

  • make all shows no errors
  • make test show no errors
  • all sys-* VMs running fedora-30
  • start/restart an AppVM, confirm qvm-open-in-dvm <file> opens in an SDW netless VM

One improvement we could make here is to also uninstall the template (sudo dnf remove qubes-template-fedora-29), as it will no longer be required, and will only increase upgrade time and likelihood of misconfigurations.

@conorsch
Copy link
Contributor Author

One improvement we could make here is to also uninstall the template (sudo dnf remove qubes-template-fedora-29), as it will no longer be required, and will only increase upgrade time and likelihood of misconfigurations.

Good point. During standup today, @kushaldas mentioned he'd like to keep the older F templates around. We may be forced to do so for a while, or at least update the logic here to vigorously replace all templates. For instance, I had sd-template-builder and sd-onionshare that were still on F29 (and manually updated them to F30).

I'll open a follow up ticket to discuss cleanup, which will also be relevant for the W14 -> W15 upgrades (#300), deferring changes for now.

@conorsch conorsch merged commit 620c2de into master Nov 13, 2019
@emkll emkll deleted the 262-upgrade-sys-vms-to-fedora-30 branch November 13, 2019 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants