EarIier I wrote about some ways to modify VM disk images used by Unetlab. Basically it boils down to running a VM, console to it and change things through its shell. Obviously, this approach is no way near a handy way to do small changes like:
- loading basic config
- adding license files
In this post I will talk about guestfish
utility which is a part of libguestfs
tools set. With guestfish
one could easily get a shell-like access to the filesystem located on a disk image (qcow2, vmdk, iso and many others). That is how authors of libguestfs
tools describe it:
libguestfs can access almost any disk image imaginable. It can do it securely — without needing root and with multiple layers of defence against rogue disk images. It can access disk images on remote machines or on CDs/USB sticks. It can access proprietary systems like VMware and Hyper-V.
To demonstrate the way how guestfish works I will solve a particular task of adding a license file to Nokia (Alcatel-Lucent) 7750 Virtual Service Router (VSR) by embedding it to the disk image itself. Tune in!