I use QEMU to run a Windows 10 virtual machine (VM) on an Ubuntu host. My goal is to programmatically instruct the VM to run a specific GUI program in the foreground, as if the user had started the program.
The Windows guest already has the guest agent installed. On the host I can execute
virsh qemu-agent-command win10_vm "{\"execute\": \"guest-exec\", \"arguments\": { \"path\": \"notepad.exe\", \"arg\": [], \"capture-output\": true}}"
and I can see from the task manager that notepad.exe is executed in the background. However, I would have liked the GUI to open.
What I tried so far without success:
- On the Windows guest, run the guest agent service as the user.
- For the qemu-agent-command, change path to execute from
notepad.exe
tostart notepad.exe
, but then the command failed with an error.
Does anyone know how to instruct the VM to run a program in the foreground?