qubes-issues icon indicating copy to clipboard operation
qubes-issues copied to clipboard

qubes-dist-upgrade cannot be completed if all VMs shut down and USB keyboard in use

Open greenrd opened this issue 1 year ago • 5 comments

Qubes OS release

4.1

Brief summary

I guess this is a user error, but if I have a USB VM, I choose to shut down all VMs when prompted, and I have a USB keyboard, and I don't pass -y, qubes-dist-upgrade can't complete, because it waits for me to press y but I can't because the USB VM has shut down.

Steps to reproduce

  1. qubes-dist-upgrade -t -k
  2. qubes-dist-upgrade -r -k
  3. qubes-dist-upgrade -s -k

Expected behavior

Should get warning about USB keyboards and USB VMs before asking if I want to shut down all VMs. Or maybe USB VM should be excluded/excludable.

Actual behavior

No warning message

Tasks

  • [ ] Change --keep-running handling to exclude listed VMs from shutting down in all stages - currently it doesn't work in stage 3
  • [ ] Automatically collect VMs used for input devices (see comment below), inform the user about that, and add an option to disable this feature
  • [ ] While at it, fix qubes and fedora version in help message

greenrd avatar Mar 14 '24 12:03 greenrd

There is a --keep-running option, but I don't think it applies to all stages. But also, checking for USB keyboard and showing a warning (if not excluding USB VM(s) automatically) makes much sense.

marmarek avatar Mar 14 '24 12:03 marmarek

Checking if USB keyboard (or mouse) is used can be done by looking at xinput command - devices from sys-usb will have sys-usb: prefix. In fact, a better option would be to look at all xinput devices with some colon-separated prefix and consider those VMs (if such prefix matches any existing VM) to be automatically excluded. Device connected via USB VM cannot fake this prefix, and device connected to dom0 directly is unlikely to match any existing VM (and even if it does, the impact would be minimal).

marmarek avatar Mar 14 '24 12:03 marmarek

Checking if USB keyboard (or mouse) is used can be done by looking at xinput command - devices from sys-usb will have sys-usb: prefix. In fact, a better option would be to look at all xinput devices with some colon-separated prefix and consider those VMs (if such prefix matches any existing VM) to be automatically excluded. Device connected via USB VM cannot fake this prefix, and device connected to dom0 directly is unlikely to match any existing VM (and even if it does, the impact would be minimal).

It looks like we don't have xinput available by default on R4.2 so we might need to take care of that on the next iteration of the tool for 4.2 -> 4.3.

fepitre avatar Apr 27 '24 08:04 fepitre

It looks like we don't have xinput available by default on R4.2 so we might need to take care of that on the next iteration of the tool for 4.2 -> 4.3.

Add it as a dependency for the qubes-dist-upgrade package?

marmarek avatar Apr 27 '24 10:04 marmarek

It looks like we don't have xinput available by default on R4.2 so we might need to take care of that on the next iteration of the tool for 4.2 -> 4.3.

Add it as a dependency for the qubes-dist-upgrade package?

There is libinput binary that is already present in dom0 and it can be used instead of xinput:

libinput list-devices

apparatius avatar Apr 27 '24 11:04 apparatius

Automated announcement from builder-github

The component dist-upgrade (including package qubes-dist-upgrade-4.1.6-1.fc32) has been pushed to the r4.1 testing repository for dom0. To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

qubesos-bot avatar May 11 '24 11:05 qubesos-bot

Automated announcement from builder-github

The component dist-upgrade (including package qubes-dist-upgrade-4.1.6-1.fc32) has been pushed to the r4.1 stable repository for dom0. To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

qubesos-bot avatar May 21 '24 13:05 qubesos-bot