Libguestfs is tools and a library for accessing and modifying guest
disk images. For more information see the home page:
http://libguestfs.org/
For discussion, development, patches, etc. please use the mailing
list:
http://www.redhat.com/mailman/listinfo/libguestfs
To find out how to build libguestfs from source, read:
docs/guestfs-building.pod
http://libguestfs.org/guestfs-building.1.html
man docs/guestfs-building.1
Copyright (C) 2009-2020 Red Hat Inc.
The library is distributed under the LGPLv2+. The programs are
distributed under the GPLv2+. Please see the files COPYING and
COPYING.LIB for full license information. The examples are under a
very liberal license.
####################################################################
To build libguestfs from this repository
$ https://github.com/MuralidharB/libguestfs-1.44.1.git
$ cd libguestfs-1.44.1
$ export GO111MODULE=auto # Need this as the golang working directory is not a module, hence this env should be set to 'auto' instead of 'on'.
$ aclocal
$ ./autogen.sh # you may need to run it again if the first invocation fails
# autogen.sh may overwrite some of our modifications because these are autogenerated files
# We have yet to figure out how to make changes to original files. Please checkout the
# files again from the repo. These files are:
1. include/guestfs.h
2. fish/run-2.c
3. lib/actions-2.c
4. golang/src/libguestfs.org/guestfs/guestfs.go
$ make
To verify that the build is successful and the new binary supports encrypted qcow2 images, follow these steps:
$ dd if=/dev/urandom of=/tmp/base bs=1M count=1024
$ qemu-img convert -p --object secret,id=sec0,data=backing --object secret,id=sec2,data=backing --image-opts driver=raw,file.filename=/tmp/base -O qcow2 -o encrypt.format=luks,encrypt.key-secret=sec2 /tmp/base.qcow2
$ qemu-img create -f qcow2 --object secret,id=sec0,data=backing -b 'json:{ "encrypt.key-secret": "sec0", "driver": "qcow2", "file": { "driver": "file", "filename": "/tmp/base.qcow2" }}' -o encrypt.format=luks,encrypt.key-secret=sec0 /tmp/overlay.qcow2 1G
$ ./run guestfish
<fs> add driver=qcow2,file.filename=/tmp/overlay.qcow2,encrypt.key-secret=sec0 object:secret,id=sec0,data=backing
<fs> run
The appliance should successfully boot and provide with prompt