My Debian 12 VM went to sleep, how do I gracefully wake it up ?

shodan

Active Member
Sep 1, 2022
219
61
33
I tried waving the cursor around in the vnc window. No effect
Lots search results discuss waking them up with wakeonlan packets ?
But I couldn't find any definitive answer or even the hint of a solution.

Maybe there's a keepalive device I could attach ?

I can't even find people discussing having this issue, as if I were the first person that did nothing for a few minutes after installing a desktop OS in a VM.

I found this "solution"

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Which is dirty, as it breaks sleeping but the OS still tried going to sleep but can't.

I imagine there is somewhere in the interface, a way to send ACPI button press events to simulate pressing the power button but I just can't find it ?
 
Proxmox seems to think it's still running, but the console showed it was going to sleep and became unresponsive.
In novnc the screen is black
 
No I have default settings and I would rather not setup this temporary VM if it isn't strictly necessary.

I have qemu guest agent support turned off (default value) and I have ACPI support turned on.

I think I just need to someone put the "power" button or "suspend" button ?
Or send the kind of IRQ that would wake up the system from it's sleep state ?

Is there not a way to do this ?

If not then how does one get out of sleep on a virtual machine with no guest agent support ?
 
To disable sleeping within the Debian GUI see here. Apparently that's for Gnome desktop. I'm pretty sure other's have similar.
 
I think I just need to someone put the "power" button or "suspend" button ?
EDIT:
Pressing "Esc" from noVNC Keyboard wake up VM here (test with a vanilla Debian 12 & vanilla Ubuntu 24 )

BTW :
in Debian 12, "Automatic Suspend" is set to 20 minutes ( weird, should be inactive by default if VM detected).
and "qemu-guest-agent" package is auto installed.
in Ubuntu 24, there isn't "Automatic suspend" available and "qemu-guest-agent" isn't installed.
 
Last edited:
I am exploring this once again

I have tried

Code:
root@proxmox:~# qm resume 118
root@proxmox:~#

This does not produce an error, and in the web interface it says "OK"

1754358052508.png

However, it is not "OK"
Since the VM does not wake

I imagine this function depends on the qemu-guest-agents
Which are often not available of very hard to install

This particular VM has DISPLAY set to none, so pressing ESC in novnc does not work


But I did find a way to wake up the VM

Code:
qm sendkey 118 power

This works, the ssh session resumes without needing a reconnect


However, in this first attempt, the SDDM lock screen comes on but is frozen.

No keyboard no mouse input and the clock time is frozen to the time of wake up.

Still better than "suspend means stop"



At this point I ran systemctl suspend


Code:
user@debian:~$ systemctl suspend
Error registering authentication agent: Timeout was reached (g-io-error-quark, 24)
Call to Suspend failed: Connection timed out
Failed to start suspend.target: Connection timed out
See system logs and 'systemctl status suspend.target' for details.
user@debian:~$

While this command failed, it did at least reset the machine state
and now it is back to the SDDM screen, and it works
Well, it worked until I tried to unlock back to plasma, and then the image and input froze



But anyway

Lesson is, if you are coming from google asking "proxmox how resume suspend sleep"

The answer is

Code:
qm sendkey 118 power