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"
 

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!