How To Install libguestfs on CentOS 7

In this tutorial we learn how to install libguestfs on CentOS 7. libguestfs is Access and modify virtual machine disk images

Introduction

In this tutorial we learn how to install libguestfs on CentOS 7.

What is libguestfs

Libguestfs is a library for accessing and modifying virtual machine disk images. http It can be used to make batch configuration changes to guests, get disk used/free statistics (virt-df), migrate between hypervisors (virt-p2v, virt-v2v), perform backups and guest clones, change registry/UUID/hostname info, build guests from scratch (virt-builder) and much more. Libguestfs uses Linux kernel and qemu code, and can access any type of guest filesystem that Linux and qemu can, including but not limited to disk partition schemes, qcow, qcow2, vmdk. Libguestfs for Red Hat Enterprise Linux is split into several subpackages. The basic subpackages are libguestfs C library libguestfs-tools virt-* tools, guestfish and guestmount (FUSE) libguestfs-tools-c only the subset of virt tools written in C (for reduced dependencies) virt-dib safe and secure diskimage-builder replacement virt-v2v convert virtual machines to run on KVM (V2V) virt-p2v-maker convert physical machines to run on KVM (P2V) For enhanced features, install libguestfs-gfs2 adds Global Filesystem (GFS2) support libguestfs-inspect-icons adds support for inspecting guest icons libguestfs-rescue enhances virt-rescue shell with more tools libguestfs-rsync rsync to/from guest filesystems libguestfs-xfs adds XFS support For developers libguestfs-devel C/C++ header files and library libguestfs-benchmarking Benchmarking utilities Language bindings libguestfs-gobject-devel GObject bindings and GObject Introspection libguestfs-java-devel Java bindings lua-guestfs Lua bindings ocaml-libguestfs-devel OCaml bindings perl-Sys-Guestfs Perl bindings python-libguestfs Python bindings ruby-libguestfs Ruby bindings

We can use yum or dnf to install libguestfs on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install libguestfs.

Install libguestfs on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install libguestfs using yum by running the following command:

sudo yum -y install libguestfs

Install libguestfs on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install libguestfs using dnf by running the following command:

sudo dnf -y install libguestfs

How To Uninstall libguestfs on CentOS 7

To uninstall only the libguestfs package we can use the following command:

sudo dnf remove libguestfs

References

Summary

In this tutorial we learn how to install libguestfs on CentOS 7 using yum and dnf.