[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] Can I use libguestfs to pass some parameters into a KVM virtual machine

On Tue, Aug 04, 2009 at 09:26:31AM +0800, Zhang Qian wrote:
> I have installed KVM in my RHEL5.3 box, and created some VMs on it.
> I am wondering if I can use libguestfs to pass some parameters/files
> into my VMs. As you may know, for Xen, I can use xenstore command to
> do this job, can libguestfs do the same thing?
> What I want to do includes:
> 1. Modify some configurations in my VM, such as editing
> /etc/sysconfig/network-scripts/ifcfg-eth0 to add a static IP for my
> VM.
> 2. Upload a script into my VM and run it in the guest OS.

Yes, this is precisely what libguestfs is for.  Make sure the virtual
machine is shut down before you try to modify it.

> Is here any sample C code I can refer to?

There are some very simple examples in the source:


And the documentation of the C API:


See in particular:



Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]