[Copying the message I sent to lzap about how the libguestfs icon inspection works]
The code is all here:
https://github.com/libguestfs/libguestfs/blob/master/src/inspect-icon.c
You might as well use the API:
http://libguestfs.org/guestfs.3.html#inspection http://libguestfs.org/guestfs.3.html#guestfs_inspect_get_icon
We don't have a specific example of using this API, but you could adapt this example:
http://libguestfs.org/guestfs-python.3.html#example-2:-inspect-a-virtual-mac...
Put this code:
pngdata = g.inspect_get_icon () if pngdata != "": # some code here that displays the PNG data using your # choice of graphics library
just before the unmount call at the end.
Rich.