qm reboot <vmId> is not a real 'reboot' ?

nodjoy

New Member
Dec 27, 2023
6
0
1
The vm is windows10,
When I execute "qm reboot 100", the virtual machine does not trigger a restart, but rather shuts down and then powers on again.
I hope the vm to display "rebooting" instead of "shutting down"
 
Last edited:
When I execute “qm reboot 100” and it doesn’t trigger a reboot, the vm displays “Shutting down” instead of "Restarting".

So I am no expert on Windows guests, but I would suspect you can only get the "restarting" when you restart from within the OS. The qm command tells it to shut down (gracefully) and then goes on to start it up (which the guest OS cannot know in advance).

What is your concern about any (?) difference in the resulting freshly started guest OS after such command?
 
So I am no expert on Windows guests, but I would suspect you can only get the "restarting" when you restart from within the OS. The qm command tells it to shut down (gracefully) and then goes on to start it up (which the guest OS cannot know in advance).

What is your concern about any (?) difference in the resulting freshly started guest OS after such command?
Thank you for your response. “Shutting down” will cause the Spice connection to disconnect. I need the status to be “Restarting” to ensure that the Spice connection remains active.
 
Thank you for your response. “Shutting down” will cause the Spice connection to disconnect. I need the status to be “Restarting” to ensure that the Spice connection remains active.

I see. I do not know the answer on whether you can keep your SPICE conn open for that situation, definitely do not know that with Windows guest, but I would suggest you change title so that it reflects the concern (keeping SPICE on restarting Win VM) and someone else might chip in.
 
Thank you for your response. “Shutting down” will cause the Spice connection to disconnect. I need the status to be “Restarting” to ensure that the Spice connection remains active.
I believe you will need to instead execute a command using the QEMU guess tools. First, make sure the QEMU guest agent is installed (following the instructions from the wiki) and then run something like this: qemu guest exec <VM_ID> -- shutdown \/r. Note that it might not be necessary to escape the /r flag. I don't have a Windows VM to test with unfortunately.

The qemu guest exec command executes the given command via the guest agent, according to the manpages.

EDIT: OK, I found an old thread and they used a similar command:

qm guest exec <VM_ID> C:\WINDOWS\SYSTEM32\CMD.EXE /c "shutdown /r"
 
Last edited:
  • Like
Reactions: nodjoy
I believe you will need to instead execute a command using the QEMU guess tools. First, make sure the QEMU guest agent is installed (following the instructions from the wiki) and then run something like this: qemu guest exec <VM_ID> -- shutdown \/r. Note that it might not be necessary to escape the /r flag. I don't have a Windows VM to test with unfortunately.

The qemu guest exec command executes the given command via the guest agent, according to the manpages.

EDIT: OK, I found an old thread and they used a similar command:

qm guest exec <VM_ID> C:\WINDOWS\SYSTEM32\CMD.EXE /c "shutdown /r"
Thanks for your reply.This should be a great method.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!