[fedora-virt] libguestfs on non-Fedora targets

Richard W.M. Jones rjones at redhat.com
Wed May 6 12:02:16 UTC 2009


On Sun, May 03, 2009 at 07:05:37PM -0500, Charles Duffy wrote:
> Howdy. Is there any intention of supporting libguestfs on non-Fedora  
> targets (given a sufficiently new qemu or kvm)?

First of all, sorry for the delay in answering (I'm currently on
holiday).  Secondly, thank you for your detailed and specific bug
reports.

Many of these things are simply bugs in libguestfs and/or febootstrap.
We don't have a bug tracker for libguestfs yet, and so I will add
these to the top level 'BUGS' file in the git repo (shortly).

> As background: I have a bunch of in-house QA infrastructure, which  
> happens to include my own, internally developed tools intended to  
> address the same problems as libguestfs. (One tool, for FUSE-mounting  
> from a guest, used serial ports rather than the vmchannel mechanism, a  
> buildroot/uClibc embedded userland rather than a stripped Fedora,  
> qemu-nbd+nbd-client proxied over serial for getting the block device  
> into the guest, UML rather than qemu or kvm, and a patched ccgfs+FUSE  
> for getting the guest's filesystem back out onto the host).

Yes, this is certainly an approach that we looked at.  The reasons why
we chose to not do this are summarised on my blog here:

http://rwmj.wordpress.com/2009/03/20/why-not-use-a-minimal-distribution/

> Libguestfs is clearly more mature and flexible than my personal hackery,  
> so I'm looking at migrating to it -- but right now, I'm having trouble  
> building it for my VM servers' platform, which is effectively RHEL5 with  
> kvm-85 and a modern host kernel. Specific issues follow:
>
> ----
>
> futimens() isn't available on glibc 2.5, and do_touch() doesn't  
> presently degrade gracefully to a less-capable call without it:

Yes, this is obviously a bug in libguestfs.  Noted.

> guestfsd-file.o: In function `do_touch':
> /home/cduffy/public_git/libguestfs/daemon/file.c:49: undefined reference  
> to `futimens'
>
> ----
>
> It was necessary to explicitly set OCAMLC=no OCAMLFIND=no (bypassing  
> build of the ocaml bits) to prevent the build from breaking early,  
> apparently due to C interface changes between the expected OCaml and the  
> ocaml-3.09.3-1.el5 which is present. [TODO: more detail]

Also a bug in libguestfs.  Noted.  We shouldn't depend on anything in
OCaml 3.10, but since I haven't tested it with any earlier versions,
there is some hidden assumption somewhere.

> ----
>
> make-initramfs had numerous complaints:
> + it expected /var/lib/yum to exist within the initramfs root, which it  
> did not

A bug in febootstrap.  Noted as http://bugzilla.redhat.com/499369

> + library versions mismatched between host and guest: libtinfo.so.5  
> (from ncurses, needed by /bin/sh) isn't available on RHEL5 natively  
> (easily worked around), and the glibc versions don't match (not easily  
> worked around).

The background to this one is that we build an appliance with one
Fedora distro (eg. Fedora 10), and we also build on a possibly
different platform (eg. CentOS 5).  Copying programs built on the
host (eg. guestfsd) to the appliance is problematic.

This appears to be a similar, but different problem, with febootstrap
/ yum.  I'm a little confused actually because there shouldn't be a
mismatch possible here.

Anyhow, when building libguestfs in Fedora, we avoid any problems by
making sure the appliance is built from precisely the same RPMs as the
host distribution.  So copying guestfsd from the host to the appliance
should not present any problem.

When building on CentOS 5.3, I intend that the appliance should also
be CentOS 5.3.

> + unless my PATH included /usr/sbin, builds failed with  
> "/usr/bin/fakechroot: line 107: exec: chroot: not found"

I suspect a bug in fakechroot, but I will look into this one in more
detail later today.

> + rpm %pre scripts all failed due to the previously mentioned version  
> mismatches.
>
> ----
>
> I haven't gotten beyond the last of these issues on account of the glibc  
> mismatch. Before I proceed -- is my goal reasonable, or am I better off  
> sticking with my in-house solution for the time being?

Well I hope you can use libguestfs of course!

Anyhow, I am currently building, or trying to build, libguestfs and
the dependencies for CentOS 5.3 (i386).  I will follow up with notes
as things proceed.

Thanks again for the bug reports.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw




More information about the Fedora-virt mailing list