0

We have multiple OpenSuse VMs running on a server via KVM. Our users access the VMs via Guacamole as a xrdp session. If the VMs are in status "shut off" or "pause" a magic packet send from the guacamole Server is triggering a script based service which will "start" or "resume" the specific VM.

The problem now. If my users shutdown their VM, the VM doesn't switch to status "shut off" instead it stays in status "running". The issue is now that the system stalls and does not load the Desktop.

I expected the machine to shutdown to save system resources if the VM is not needed. Shutting down the VM with virsh is working as expected.

MaKaNu
  • 101
  • 1
  • KVM is a kernel machine; what userspace tool you are using to run it (e.g. libvirt, etc.) and how is the VM configured in that tool? It is *possible* configure it so it won't "power off" the VM in the event of shutdown, but it depends on the tool. In libvirt check `` setting; your behaviour described as if it is set to `ignore`. – Nikita Kipriyanov May 30 '22 at 13:23
  • I mostly use `virsh` for controlling and editing the VMs. The `on_poweroff` is set to `destroy`. – MaKaNu May 30 '22 at 13:32
  • `virsh` is the part of `libvirt` toolset. So strange, and so when your system was shut down what's on the "screen" (enable VNC and see), and what it is doing (does it load CPU, I/O, etc.)? – Nikita Kipriyanov May 30 '22 at 13:34
  • It seems the VM is started directly again. VNC works as usual and send me to the login screen. This might be the problem with XRDP, since the guacamole connection is not allowed to login to other users. This explains the "stall". – MaKaNu May 30 '22 at 13:45
  • Can you confirm `qemu` process running the VM is the same (based on the PID and the startup time) or the not? E.g. it *did not stop* at all, or it was stopped (destroyed) and then immediately started back again? If the latter, you might need to find out what starts it back. – Nikita Kipriyanov May 30 '22 at 13:49
  • The qemu PID for the VM stays the same. So I assume it is not getting destroyed. – MaKaNu May 30 '22 at 16:14
  • Are you sure it is being put into shutdown in the first place? How exactly you are doing this? Try to give a explicit command `shutdown -h now`, and check if it really shuts the system down. – Nikita Kipriyanov May 30 '22 at 17:44
  • I used the kde plasma menu to shutdown the VM. Since it kind of similar to my day-2-day system and there doing the same as `shutdown -h now` I thought it would do the same. The Problem our users are not superusers and I needed to call `sudo shutdown -h now`, which worked. I wander what is happening while I use the Plasma Menu. – MaKaNu May 30 '22 at 22:20

0 Answers0