[libvirt] Can I run a shell script in Guest OS via libvirt

Eric Blake eblake at redhat.com
Fri Jul 27 13:19:39 UTC 2012


On 07/26/2012 10:16 PM, Doan Van Tuyen wrote:
> Hi all.
> 
> I amd trying to use libvirt-php to build a public cloud. I used Vmware
> hypervisor (free), XEN and KVM. Now I want to create a Virtual Machine from
> template. After that, I want to install some application on that VM.
> 
> *Can I run a shell script in Guest OS via Libvirt?*

Not directly.  It may be possible to enhance the qemu guest-agent in
order to request via the guest agent that the guest run a script; and
there has been a proposal (although no code yet) for adding support for
running arbitrary guest-agent commands from libvirt in the case where
libvirt has not yet incorporated a particular agent command into
existing commands.

You may also be interested in checking out libguestfs, which provides a
lot of utilities, including the ability to modify the disk image of an
offline guest in order to install applications.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120727/db9fdb11/attachment-0001.sig>


More information about the libvir-list mailing list