How to run a command in Windows Guest from Host?

sonuyos

Active Member
Jun 18, 2020
45
0
26
29
Hello,

I have a QEMU Enabled, Guest Agent installed, Windows VM with Cloud-init, and i wanted to execute a command from my host without logging into the server From my host.

Is there any way?

What i want to do is, open a command box and type

"slmgr.vbs -rearm"

Which will reactivate the windows. Any way to do this?

I want to do it From my host.
 
you could use the qemu-guest-agent and 'qm guest exec' (see man qm for details)
 
you could use the qemu-guest-agent and 'qm guest exec' (see man qm for details)
Thanks,

i crafted this command.

Code:
qm guest exec $vmid "C:\WINDOWS\system32\cmd.exe" -- "/c slmgr.vbs -rearm"
qm guest exec $vmid "C:\WINDOWS\system32\cmd.exe" -- "/c shutdown -r"