<div dir="ltr">Thanks Rich.<div><br></div><div>Best Regards,</div><div>Allen<br><div class="gmail_extra"><br><div class="gmail_quote">2016-04-08 5:54 GMT+08:00 Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Apr 07, 2016 at 10:12:07PM +0800, Baochuan Wu wrote:<br>
> Hi All,<br>
><br>
> I installed CentOS 7 as Xen Guest OS(DomU OS), I wonder if it is possible<br>
> to use libguestfs in this CentOS 7 VM? libguestfs-test-tools reports error:<br>
</span>[...]<br>
<span class="">> Original error from libvirt: internal error: process exited while<br>
> connecting to monitor: Cannot set up guest memory 'pc.ram': Cannot allocate<br>
> memory<br>
</span>[...]<br>
<span class="">> Cannot set up guest memory 'pc.ram': Cannot allocate memory<br>
> libguestfs: error: appliance closed the connection unexpectedly, see<br>
> earlier error messages<br>
<br>
</span>It looks as if you VM has very limited RAM, not enough to start up the<br>
qemu instance.  If you give your VM more memory, then libguestfs<br>
should work fine.  We run libguestfs nested all the time.<br>
<br>
> After running "*export LIBGUESTFS_BACKEND=direct*", it seems libguestfs<br>
<span class="">> will launch another VM inside my VM. Is this necessary?<br>
<br>
</span>That's how libguestfs works:<br>
<br>
  <a href="http://libguestfs.org/guestfs-internals.1.html" rel="noreferrer" target="_blank">http://libguestfs.org/guestfs-internals.1.html</a><br>
<br>
Rich.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
virt-df lists disk usage of guests without needing to install any<br>
software inside the virtual machine.  Supports Linux and Windows.<br>
<a href="http://people.redhat.com/~rjones/virt-df/" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones/virt-df/</a><br>
</font></span></blockquote></div><br></div></div></div>