guestfs-gobject(3)

✨ guestfs-gobject ✨

okay bestie, welcome to the Virtualization Support corner of the manual, this is guestfs-gobject(3) and it's all about using libguestfs through the GObject bindings πŸ’…


πŸ’€ DEPRECATED πŸ’€

ngl this is the sad part. These bindings are deprecated and they will be removed in libguestfs 1.58. so like... enjoy them while they last, but maybe don't build your whole personality around them 🫢


🌸 SYNOPSIS 🌸

From Javascript using gjs:

const Guestfs = imports.gi.Guestfs;
var g = new Guestfs.Session();
g.add_drive('disk.img', null);
g.launch();
g.close();

πŸ¦‹ DESCRIPTION πŸ¦‹

This manual page documents how to call libguestfs using GObject bindings, especially from Javascript. it's giving "here's how you talk to the C library but make it ✨fancy✨"

okay but real talk, there's a catch: the GObject bindings have problems handling 64 bit values. so if your language has native bindings, you should not use the GObject ones. periodt. for example, to use libguestfs from Python you are strongly advised to use the Python native bindings instead (see guestfs-python(3)). that's the move πŸ’–

This page just documents the differences from the C API and gives some examples. and if you're not familiar with using libguestfs at all, you also need to read guestfs(3) first. no skipping bestie, i see you πŸ‘€


🌈 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

that's literally it. iconic. slay ✨


πŸ‘‘ SEE ALSO πŸ‘‘

guestfs(3), guestfs-examples(3), guestfs-erlang(3), guestfs-golang(3), guestfs-java(3), guestfs-lua(3), guestfs-perl(3), guestfs-python(3), guestfs-recipes(1), guestfs-ruby(3), http://libguestfs.org/.

the whole friend group fr fr 🫢


πŸ’œ AUTHORS πŸ’œ

Richard W.M. Jones (rjones at redhat dot com) β€” the main character honestly, thank you king 🌟


Copyright (C) 2012-2025 Red Hat Inc.


πŸ“œ LICENSE πŸ“œ

This manual page contains examples which we hope you will use in your programs. The examples may be freely copied, modified and distributed for any purpose without any restrictions. yes bestie, take them, they're yours, no strings attached πŸ’–


πŸ› BUGS πŸ›

To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools

To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools

When reporting a bug, please supply:

  • The version of libguestfs.
  • Where you got libguestfs (eg. which Linux distro, compiled from source, etc)
  • Describe the bug accurately and give a way to reproduce it.
  • Run libguestfs-test-tool(1) and paste the complete, unedited output into the bug report.
bestie if you report a bug without the unedited libguestfs-test-tool(1) output i will find you and i will be so disappointed 😭 please paste it all, no trimming, no vibes-based paraphrasing

and that's the whole page! this was libguestfs-1.58.1, dated 2026-01-19, from the guestfs-gobject(3) era. go forth and bind responsibly, mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from