<div dir="ltr">Thank you Eric,<div><br></div><div>I am using KVM: qemu.. I'll try to see how I can use qemu-guest-agent..</div><div>If you have links to examples on how to start with it let me know please.</div><div>Consider the following simple scenario.. </div>
<div><br></div><div>I am using KVM to run several VMs; one of OSs in the guests is Windows XP. </div><div>I want to send to it something from the Hypervisor level, e,g text,parameters,etc </div><div>so that it will be displayed in the VM screen or stored in a file so I can read from the VM later..</div>
<div>It's best to be done on a live VM. </div><div><br></div><div>How can such a simple scenario be performed. Does it have to be through the method of qemu-guest-agent??</div><div><br></div><div>Thanks alot,</div><div>
<br></div><div><br></div><div><br></div><div>T.alsaid</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 24, 2014 at 5:17 PM, Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 03/24/2014 10:36 AM, Taimur Al Said wrote:<br>
> Hi there,<br>
><br>
> I am a beginner with Libvirt. I was practicing using Python bindings with<br>
> libvirt to do some basic stuff like starting a VM, rebooting a VM,<br>
> displaying the number of domain,etc. I was wondering since the hypervisor<br>
> has control over the VMs, it is possible to use Libvirt to inject code into<br>
> the VM? Is it possible to start processes inside a particular VM using the<br>
> Libvirt API. If not, what would you recommend instead? Thanks in advance<br>
<br>
</div></div>What hypervisor are you using?  With lxc:// URI, this is already<br>
possible (see virsh lxc-enter-namespace).  With qemu:// URI, this isn't<br>
really libvirt's thing to do directly; but you might be able to enhance<br>
the qemu-guest-agent to run an arbitrary command, then install that<br>
agent in your guest, then use libvirt's 'virsh qemu-agent-command' to<br>
drive that new agent command.<br>
<br>
If the changes you want in your guest can be done while the guest is<br>
offline, then libguestfs is a great suite of tools for making all sorts<br>
of guest disk image modifications (which is as programmatic as you can<br>
get for injecting behavior changes into your guest).  But actually<br>
injecting live processes into a running qemu guest is not possible<br>
without setting up some sort of higher-level protocol, such as<br>
qemu-guest-agent.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Eric Blake   eblake redhat com    <a href="tel:%2B1-919-301-3266" value="+19193013266">+1-919-301-3266</a><br>
Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
<br>
</font></span></blockquote></div><br></div>