Libguestfs
Tools for accessing virtual disk images
title: "Libguestfs" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["application-programming-interfaces", "free-virtualization-software", "virtual-machines", "virtualization-software-for-linux"] description: "Tools for accessing virtual disk images" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Libguestfs" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Tools for accessing virtual disk images ::
::data[format=table title="Infobox software"]
| Field | Value |
|---|---|
| name | libguestfs |
| title | libguestfs |
| logo | Arthur the fish, Libguestfs logo.svg |
| logo size | 96px |
| screenshot | |
| developer | Richard Jones |
| released | |
| latest release version | 1.58.1 |
| latest release date | |
| frequently updated | |
| programming language | C; utilities in OCaml Perl, et al. |
| operating system | Linux |
| genre | Virtualization |
| license | LGPL, GPL |
| website | |
| :: |
| name = libguestfs | title = libguestfs | logo = Arthur the fish, Libguestfs logo.svg | logo size = 96px | screenshot = | caption = | collapsible = | author = | developer = Richard Jones | released = | discontinued = | latest release version = 1.58.1 | latest release date = | frequently updated = | programming language = C; utilities in OCaml Perl, et al. | operating system = Linux | platform = | size = | language = | status = | genre = Virtualization | license = LGPL, GPL | website = libguestfs is a C library and a set of tools for accessing and modifying virtual disk images used in platform virtualization. The tools can be used for viewing and editing virtual machines (VMs) managed by libvirt and files inside VMs, scripting changes to VMs, creating VMs, and much else besides. It was created to avoid security issues that occur when virtual disk images are mounted directly on the host system.
libguestfs can access nearly any type of file system including: all known types of Linux filesystem (ext2/3/4, XFS, btrfs, etc.), any Windows filesystem (VFAT and NTFS), any Mac OS X and BSD filesystems, LVM2 volume management, MBR and GPT disk partitions, raw disks, qcow2, VirtualBox VDI, VMWare VMDK, Hyper-V VHD/VHDX, on files, local devices, CD and DVD ISOs, SD cards, or remotely over FTP, HTTP, SSH, iSCSI, NBD, GlusterFS, Ceph, Sheepdog, and much more. libguestfs does not require root permissions.
The C API for libguestfs can be linked with C and C++ programs. It has official bindings for Perl, Python, Ruby, Rust, Java, OCaml, PHP, Haskell, Erlang, Lua, Golang and C#.
libguestfs comes with command-line programs that allows use from shell scripts or in the command line. Through the FUSE module, guest filesystems can be mounted on the host with the command.
libguestfs works in part by running an appliance (a tiny Linux distribution) inside of a virtual machine. This can be achieved through either qemu or libvirt. These two can in turn use either TCG (software emulation) or KVM (hardware-accelerated).
Structure
libguestfs is only one part of the larger libguestfs project. Each of the following is a separate source code archive (tarball):
- libguestfs, the library.
- guestfs-tools, the command-line programs making use of libguestfs.
- hivex, the Windows Registry editing library (with command-line programs).
- libnbd, userspace library providing a network block device client.
- nbdkit, code for a network block device server.
- supermin, tools for creating "appliances".
- virt-p2v, tool for converting a physical machine into a KVM instance.
- virt-v2v, tool for converting a non-KVM hypervisor instance into a KVM instance.
Some of these components (nbd-related and hivex) are created separately by libguestfs authors because they are needed for implementing some features in libguestfs, but can also be used independently of the image-handling functionality. Others are tools that build on libguestfs but go beyond its original scope.
Hivex
Hivex is a C library from the authors, intended for reading and writing Windows Registry Hive files. It comes with a number of console programs for processing these files. Hivex itself does not deal with virtual machine images. For editing files in VM images, libguestfs ships a program called "virt-win-reg".
References
References
- "Historical releases of libguestfs".
- "libguestfs 1.58.1 stable".
- "A reminder why you should never mount guest disk images on the host OS".
- "Description from home page".
- "Features in Fedora 12".
- "Manual page guestfs-performance(1): engineering libguestfs for greatest performance".
- "Manual page guestfs(3), sections "backend" and "backend settings".".
- "Index of /".
- "hivex - Windows Registry "hive" extraction library".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::