[Libguestfs] Libguest Problem

Richard W.M. Jones rjones at redhat.com
Thu Nov 22 08:45:09 UTC 2012


On Wed, Nov 21, 2012 at 06:59:52PM +0800, 王健 wrote:
> Hi Richard,
> I am a  user of LibguestFS.
>
> I have a problem in using LibguestFS to get the OS type of the
> virtual machine with Xenserver virtual environment.
>
> But when I use the command in Linux likes the figure1. I know that
> this disk file could add in libguestfish.

It looks OK, except that guestfish is printing a UTF-8 progress bar
which your terminal doesn't understand.  guestfish uses the following
test to decide whether or not it can output a UTF-8 progress bar:

    bar->utf8_mode = STREQ (nl_langinfo (CODESET), "UTF-8");

You can use 'guestfish --no-progress-bars' to disable progress bars.

> My code is in the figure2.  I can't get the OS info from GuestFs.  

The code looks OK.

> Could you give me some suggests?

It seems you might be using a vhd-format disk image.  It seems most
likely that qemu is having some problems decoding this format.

After adding the disk (in guestfish) and using 'run', do general
commands like 'list-filesystems' or 'list-partitions' work?

If you add '-v' option, does qemu give any error messages?

If you convert the image to raw format, does it then work?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora




More information about the Libguestfs mailing list