guestfs-gobject3
How to use libguestfs with the gobject bindings
Usage
From Javascript using gjs:
const Guestfs = imports.gi.Guestfs;var g = new Guestfs.Session();g.add_drive('disk.img', null);g.launch();g.close();
Overview
This manual page documents how to call libguestfs using GObject bindings, especially from Javascript.
Note that the GObject bindings have problems handling 64 bit values. You should not use the GObject bindings if there are native bindings for your language. For example, to use libguestfs from Python you are strongly advised to use the Python native bindings instead (see guestfs-python(3)).
This page just documents the differences from the C API and gives some examples. If you are not familiar with using libguestfs, you also need to read guestfs(3).
Javascript
Using gjs, you can write a ".js" file containing:
const Guestfs = imports.gi.Guestfs;var g = new Guestfs.Session();g.add_drive('disk.img', null);g.launch();g.close();
and then run it using:
gjs program.js
Releases
4 releases since Debian 10 (Buster); the text changed 3 times.