Is it bad to shutdown your computer with multiple vms still running, maybe even keepassxc in vault still unlocked as well?
I believe not only in qubes but in others too. it could make your files corrupt.
I several times do, force shutdown my laptop and never got an errors afterward, probably it’s because i use dispvm all time. But still, if you are not in the situation you are forced ‘too’.
Suggestion for emergency shutdown
Kernel module to handle NMI, and cause an emergency sync every time an NMI is received
Introduce a means to signal an NMI to the guest VMs CPU using XEN
Ask dom0 to signalize NMI to guests
Modify the event handler for power button (ACPI-Button pressed or the like) to do emergency sync on all reachable file systems and to issue an NMI and signalize the fact in a global state variable of the kernel that it was power button to cause NMI. Good for log facility to log *NMI-Powerbutton pressed" to the ringbuffer which can be read using dmesg.
Part1 will do emergency sync in every VM.
Something like that.
PS: if NMI is not virtualized, as it is a hardware signal, the better just have any kernel living in a CPU have a means to call emergency sync on reception of NMI.
Cause NMI to be heared by all CPUs if pulled somewhere.
This needs to be investigated (datasheets of CPUs, Xen documentation)
It would also help in case my Workstation “funny”- freezes (ps/2 unusable, rest works) again with Qubes 4.1
So syncing to disk is always nice if you feel somehow distressed
I don’t count this as an emergency shutdown.
I have done this for years with no ill effects.
The only issue faced is that a database will likely report itself as
open next time you try to open it - there are standard ways of dealing
with this, depending on the application.
I think an emergency shutdown would be pulling power, forcing immediate
I’ve also done this many times with no ill effects, on dom0 or qubes.
I doubt that either is recommended.
When I comment in the Forum or in the mailing lists I speak for myself.
Emergency sync shall be there,
not just magic sysreq and s (ps2 unusable )
But also if power button is pressed, as a long press of the power button is interpreted as hard power off by logic of your southbridge / io controllerhub, superio, depending on chipset.
In order to prepare for unplugging a power supply in emergency case a sync shall be there at least which is triggered by hw buttons like soft-power button which is present since the invention of ATX power supplies.
So a forced emergency sync, remount,ro and power off should be considered as emergency power off (police raid taking place )
BTW one could connect a burglar alert relay N.O. output in parallel to the power button thus having sync, remount ro and power off after 10sec.
The other use-case for emergency sync and optional power off is to shut down and restart a system that became unstable/unusable by some glitch, failed attack or the like.