1 TODO list for libguestfs
2 ======================================================================
4 This list contains random ideas and musings on features we could add
5 to libguestfs in future.
12 The API needs more test coverage, particularly lesser-used system
15 The big unresolved issue is UID/GID mapping between guest filesystem
16 IDs and the host. It's not easy to automate this because you need
17 extra details about the guest itself in order to get to its
18 UID->username map (eg. /etc/passwd from the guest).
20 febootstrap / debootstrap inside appliance
21 ------------------------------------------
23 This was originally proposed as a way to install new operating systems
24 in the appliance. However no one has come up with a workable
30 Complete the Haskell bindings (see discussion on haskell-cafe).
35 Add bindtests to PHP bindings.
40 Complete the bind tests - must test the return values and error cases.
42 virt-inspector - make libvirt XML
43 ---------------------------------
45 It should be possible to generate libvirt XML from virt-inspector
46 data, at least partially. This would be just another output type so:
48 virt-inspector --libvirt guest.img
50 Note that recent versions of libvirt/virt-install allow guests to be
51 imported, so this is not so useful any more.
53 "Standalone/local mode"
54 -----------------------
56 Instead of running guestfsd (the daemon) inside qemu, there should be
57 an option to just run guestfsd directly.
59 The architecture in this mode would look like:
74 (1) This only makes sense if we are running as root.
76 (2) There is no console / kernel messages in this configuration, but
77 we might consider capturing stderr from the daemon.
79 (3) guestfs_config and guestfs_add_drive become no-ops.
81 Obviously in this configuration, commands are run directly on the
82 local machine's disks. You could just run the commands themselves
83 directly, but libguestfs provides a convenient API and language
84 bindings. Also deals with tricky stuff like parsing the output of the
85 LVM commands. Also we get to leverage other code such as
88 This is mainly useful from live CDs, ie. virt-p2v.
90 Should we bother having the daemon at all and just link the guestfsd
91 code directly into libguestfs?
93 Ideas for extra commands
94 ------------------------
96 General glibc / core programs:
124 Other initrd-* commands
125 -----------------------
132 Simple editing of configuration files
133 -------------------------------------
135 Some easy non-Augeas methods to edit configuration files.
138 replace /etc/file key value
140 which would look in /etc/file for any instances of
146 and replace them with
152 That would solve about 50% of reconfiguration needs, and for the
153 rest you'd use Augeas, 'download'+'upload' or 'edit'.
155 RWMJ: I had a go at implementing this, but it's quite error-prone to
156 do this sort of editing inside the C-based daemon code. It's far
157 better to do it with Augeas, or else to use an external language like
163 Currently we can't do Perl "one-liners". ie. The current syntax for
164 any short Perl one-liner would be:
166 perl -MSys::Guestfs -e '$g = Sys::Guestfs->new(); $g->add_drive ("foo"); $g->launch; $g->mount ("/dev/sda1", "/"); ....'
168 You can see we're well beyond a single line just getting to the point
169 of adding drives and mounting.
173 $h = create ($filename, \"/dev/sda1\" => \"/\");
175 $h = create ([$file1, $file2], \"/dev/sda1\" => \"/\");
177 To mount read-only, add C<ro =E<gt> 1> like this:
179 $h = create ($filename, \"/dev/sda1\" => \"/\", ro => 1);
181 which is equivalent to the following sequence of calls:
183 $h = Sys::Guestfs->new ();
184 $h->add_drive_ro ($filename);
186 $h->mount_ro (\"/dev/sda1\", \"/\");
188 Command-line form would be:
190 perl -MSys::Guestfs=:all -e '$_=create("guest.img", "/dev/sda1" => "/"); $_->cat ("/etc/fstab");'
192 That's not brief enough for one-liners, so we could have an extra
193 autogenerated module which creates a Sys::Guestfs handle singleton
194 (the handle is an implicit global variable as in guestfish), eg:
196 perl -MSys::Guestfs::One -e 'inspect("guest.img"); cat ("/etc/fstab");'
198 How would editing files work?
204 http://man.linux-ntfs.org/ntfsclone.8.html
210 http://search.cpan.org/~rgiersig/IO-Tty-1.08/Pty.pm
211 http://www.perlmonks.org/index.pl?node_id=582185
213 Note that pty requires cooperation inside the C code too (there are
214 two sides to a pty, and one has to be handled after the fork).
216 Windows-based daemon/appliance
217 ------------------------------
219 See discussion on list:
220 https://www.redhat.com/archives/libguestfs/2009-November/msg00165.html
225 Add -drive file=...,lock=exclusive and -drive file=...,lock=shared
227 Change libguestfs and libvirt to do the right thing, so that multiple
228 instances of qemu cannot stomp on each other.
233 For multi-level disk images such as live CDs:
234 http://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/
236 It's possible with libguestfs to recursively look for anything that
237 might be a filesystem, mount-{,loop} it and look in those, revealing
238 anything in a disk image.
240 However this won't work easily for VM disk images in the disk image.
241 One would have to download those to the host and launch another
244 List, mount filesystems by UUID and label
245 -----------------------------------------
248 http://www.redhat.com/archives/libguestfs/2009-August/msg00031.html]
250 List filesystems by UUID or label.
252 Mount filesystems by UUID or label. (I'm not really sure if we can do
253 this at the moment but we ought to be able to do it, and perhaps make
254 it easier by having a direct command).
256 Map filesystems to disk blocks
257 ------------------------------
259 Map files/filesystems/(any other object) to the actual disk
266 Integration with host intrusion systems
267 ---------------------------------------
269 Perfect way to monitor VMs from outside the VM. Look for file
270 hashes, log events, login/logout etc.
272 http://www.ossec.net/
273 http://la-samhna.de/samhain/
274 http://sourceforge.net/projects/aide/
275 http://osiris.shmoo.com/
276 http://sourceforge.net/projects/tripwire/
278 -N option should be generated
279 -----------------------------
281 '-N' option should generate documentation in guestfish(1) manpage.
286 https://www.redhat.com/archives/libguestfs/2010-June/msg00053.html
287 https://www.redhat.com/archives/libguestfs/2010-June/msg00079.html
289 Regression test on virt-inspector
290 ---------------------------------
292 Occasionally we break virt-inspector through some change. We should
293 add a regression test for it. However this is hard because we'd need
294 to avoid having to carry huge images.
296 Update: I managed to fit a real-but-minimal Fedora 13 image into 6.2 MB.
297 See: http://rwmj.wordpress.com/2010/09/07/tip-pack-files-into-a-new-disk-image/#content
299 Freeze/thaw filesystems
300 -----------------------
302 Access to these ioctls:
303 http://git.kernel.org/linus/fcccf502540e3d7
305 Tips for new users in guestfish
306 -------------------------------
309 Tip: You need to 'add disk.img' or 'alloc disk.img nn' to make a new image.
310 Type 'notips' to disable tips permanently.
312 Tip: You need to type 'run' before you can see into the disk image.
314 Tip: Use 'list-filesystems' to see what filesystems are available.
315 ><fs> list-filesystems
317 Tip: Use 'mount fs /' to mount a filesystem.
318 ><fs> mount /dev/vda1 /
319 Tip: Use 'll /' to view the filesystem or ...
322 New guestfish commands
323 ----------------------
325 'list-filesystems' => list mountable filesystems
327 We could implement this as a new API call, replacing a number of areas
328 of the current code where this is done already (in virt-inspector and
329 elsewhere). What we normally do to find out if a partition contains a
330 mountable filesystem is to just blindly mount it, and see if that
331 succeeds. However the kernel won't let us do this if the filesystem
332 is already mounted somewhere, so a naive implementation of this in the
333 daemon won't work. We would have to check if the partition was
336 Could we make guestfish interactive if commands are used without params?
337 ------------------------------------------------------------------------
347 How can we solve these common user problems?
349 [space for common problems here]
351 Better support for encrypted devices
352 ------------------------------------
354 Currently LUKS support only works if the device contains volume
355 groups. If it contains, eg., partitions, you cannot access them.
356 We would like to add:
358 - An easier way to use this from guestfish.
359 - Direct access to the /dev/mapper device (eg. if it contains
360 anything apart from VGs).
365 Display the structure of an image file as a PS.
367 Greater use of blkid / libblkid
368 -------------------------------
370 guestfs_zero should use wipefs. See wipefs(8).
372 There are various useful functions in libblkid for listing partitions,
373 devices etc which we are essentially duplicating in the daemon. It
374 would make more sense to just use libblkid for this.
376 There are some places where we call out to the 'blkid' program. This
377 might be replaced by direct use of the library (if this is easier).
379 Remove repo from appliance name
380 -------------------------------
382 There's no need to have the appliance name contain the repository name
383 (ie initramfs.x86_64.img instead of initramfs.fedora-13.x86_64.img).
388 Eric Sandeen pointed out the blktrace tool which is a better way of
389 capturing traces than using patched qemu (see
390 contrib/visualize-alignment). We would still use the same
391 visualization tools in conjunction with blktrace traces.
396 Virt-df and any other tools with --csv output should be able to print
397 UUID of domain. This allows you to track the real domain across
403 guestfs_add_domain (g, "libvirt-dom");
405 However this would need to not depend on libvirt, eg. loading it