First a quick refresher on how libguestfs works. Normally when you run libguestfs on a disk image, we launch a qemu process running a small custom appliance. Inside the appliance is a Linux kernel, Linux userspace tools (like mkfs, parted, LVM), and a daemon called guestfsd.

By the way, it’s a common mistake for people to think that the qemu process is the virtual machine. It’s not the VM. It’s a custom, minimal appliance containing our own tools, and the VM is not running.
Although we used fork to run qemu, we don’t talk to the daemon over stdin/stdout. We use a fast virtio-serial port instead.
Across the virtio-serial port, we send simple commands using an efficient XDR-based remote protocol. Many libguestfs API functions directly map to remote procedure calls in this protocol.
For example, calling guestfs_mkfs in the library, translates to a mkfs remote procedure call over the virtio-serial port, and ultimately guestfsd runs the mkfs command inside the appliance.
Libguestfs live is a simple extension of this idea. Instead of running our own qemu and connecting to a virtio-serial port, how about we allow libguestfs to attach to any existing port? We rely on someone else to start up a guest, install guestfsd in it, and set up the virtio-serial ports, and we just attach to them:

At the API level, everything works very much the same. You still have to call guestfs_launch. But if you changed the attach method from the default (launching a new qemu) to connecting to unix:path, launch will just connect to the named Unix socket. guestfsd is expected to be on the other end of this socket, so usually you want to have this socket be a virtio-serial port. Then you just send ordinary libguestfs commands, which the daemon runs for you inside the guest.

This looks suspiciously like an NFS server.
libguestfs does a lot more than just accessing files. For example it can create and delete partitions and logical volumes, or resize filesystems. (Whether that is useful for you is another matter)
I have two question:
Appliance contains Linux userspace tool – so why should it contain these tool, I think everything it does come from the library`s API through virtio-serial connection right?
Thanks for any replies.
I don’t think I understand the question, but the explanation of the architecture here may help:
http://libguestfs.org/guestfs.3.html#architecture
Inside the appliance is a Linux kernel, Linux userspace tools (like mkfs, parted, LVM), and a daemon called guestfsd.
I don`t understand why should it contain these tools (mkfs, parted …) , what do these tools do ?
I`m new to Linux so maybe it`s a silly question.
Thanks 😀
The tools are there to do things like creating filesystems (mkfs), repartitioning (parted) and so on.
Understood
I read from the document that there are 2 ways that the appliance gets these tools, online or offline.
What if the appliance can`t file the tool it need in the host machine and it`s working at offline mode.
Thanks 😀
There’s not really an “online”/”offline”. I don’t know which document mentions those terms.
If guestfsd cannot find the program it needs (eg. mkfs) in the appliance, then it will give an error. The system is set up in a way that this should never happen unless the sysadmin force-deletes files from under the packaging system.
thanks, got it 😀
thanks you so much