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 Complete the bind tests - must test the return values and error cases.
37 virt-inspector - make libvirt XML
38 ---------------------------------
40 It should be possible to generate libvirt XML from virt-inspector
41 data, at least partially. This would be just another output type so:
43 virt-inspector --libvirt guest.img
45 Note that recent versions of libvirt/virt-install allow guests to be
46 imported, so this is not so useful any more.
48 "Standalone/local mode"
49 -----------------------
51 Instead of running guestfsd (the daemon) inside qemu, there should be
52 an option to just run guestfsd directly.
54 The architecture in this mode would look like:
69 (1) This only makes sense if we are running as root.
71 (2) There is no console / kernel messages in this configuration, but
72 we might consider capturing stderr from the daemon.
74 (3) guestfs_config and guestfs_add_drive become no-ops.
76 Obviously in this configuration, commands are run directly on the
77 local machine's disks. You could just run the commands themselves
78 directly, but libguestfs provides a convenient API and language
79 bindings. Also deals with tricky stuff like parsing the output of the
80 LVM commands. Also we get to leverage other code such as
83 This is mainly useful from live CDs, ie. virt-p2v.
85 Should we bother having the daemon at all and just link the guestfsd
86 code directly into libguestfs?
88 Supermin appliance to febootstrap
89 ---------------------------------
91 Supermin appliance functionality should be moved into febootstrap.
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->set_autosync (1);
185 $h->add_drive_ro ($filename);
187 $h->mount_ro (\"/dev/sda1\", \"/\");
189 Command-line form would be:
191 perl -MSys::Guestfs=:all -e '$_=create("guest.img", "/dev/sda1" => "/"); $_->cat ("/etc/fstab");'
193 That's not brief enough for one-liners, so we could have an extra
194 autogenerated module which creates a Sys::Guestfs handle singleton
195 (the handle is an implicit global variable as in guestfish), eg:
197 perl -MSys::Guestfs::One -e 'inspect("guest.img"); cat ("/etc/fstab");'
199 How would editing files work?
205 http://man.linux-ntfs.org/ntfsclone.8.html
211 http://search.cpan.org/~rgiersig/IO-Tty-1.08/Pty.pm
212 http://www.perlmonks.org/index.pl?node_id=582185
214 Note that pty requires cooperation inside the C code too (there are
215 two sides to a pty, and one has to be handled after the fork).
217 Windows-based daemon/appliance
218 ------------------------------
220 See discussion on list:
221 https://www.redhat.com/archives/libguestfs/2009-November/msg00165.html
226 Add -drive file=...,lock=exclusive and -drive file=...,lock=shared
228 Change libguestfs and libvirt to do the right thing, so that multiple
229 instances of qemu cannot stomp on each other.
234 For multi-level disk images such as live CDs:
235 http://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/
237 It's possible with libguestfs to recursively look for anything that
238 might be a filesystem, mount-{,loop} it and look in those, revealing
239 anything in a disk image.
241 However this won't work easily for VM disk images in the disk image.
242 One would have to download those to the host and launch another
245 List, mount filesystems by UUID and label
246 -----------------------------------------
249 http://www.redhat.com/archives/libguestfs/2009-August/msg00031.html]
251 List filesystems by UUID or label.
253 Mount filesystems by UUID or label. (I'm not really sure if we can do
254 this at the moment but we ought to be able to do it, and perhaps make
255 it easier by having a direct command).
257 Map filesystems to disk blocks
258 ------------------------------
260 Map files/filesystems/(any other object) to the actual disk
267 Integration with host intrusion systems
268 ---------------------------------------
270 Perfect way to monitor VMs from outside the VM. Look for file
271 hashes, log events, login/logout etc.
273 http://www.ossec.net/
274 http://la-samhna.de/samhain/
275 http://sourceforge.net/projects/aide/
276 http://osiris.shmoo.com/
277 http://sourceforge.net/projects/tripwire/
279 -N option should be generated
280 -----------------------------
282 '-N' option should be generated code, and should generate
283 documentation in guestfish(1) manpage.
288 https://www.redhat.com/archives/libguestfs/2010-June/msg00053.html
289 https://www.redhat.com/archives/libguestfs/2010-June/msg00079.html
291 Regression test on virt-inspector
292 ---------------------------------
294 Occasionally we break virt-inspector through some change. We should
295 add a regression test for it. However this is hard because we'd need
296 to avoid having to carry huge images.
298 Freeze/thaw filesystems
299 -----------------------
301 Access to these ioctls:
302 http://git.kernel.org/linus/fcccf502540e3d7
304 Tips for new users in guestfish
305 -------------------------------
308 Tip: You need to 'add disk.img' or 'alloc disk.img nn' to make a new image.
309 Type 'notips' to disable tips permanently.
311 Tip: You need to type 'run' before you can see into the disk image.
313 Tip: Use 'list-filesystems' to see what filesystems are available.
314 ><fs> list-filesystems
316 Tip: Use 'mount fs /' to mount a filesystem.
317 ><fs> mount /dev/vda1 /
318 Tip: Use 'll /' to view the filesystem or ...
321 New guestfish commands
322 ----------------------
324 'list-filesystems' => list mountable filesystems
326 We could implement this as a new API call, replacing a number of areas
327 of the current code where this is done already (in virt-inspector and
328 elsewhere). What we normally do to find out if a partition contains a
329 mountable filesystem is to just blindly mount it, and see if that
330 succeeds. However the kernel won't let us do this if the filesystem
331 is already mounted somewhere, so a naive implementation of this in the
332 daemon won't work. We would have to check if the partition was
335 Could we make guestfish interactive if commands are used without params?
336 ------------------------------------------------------------------------
346 How can we solve these common user problems?
348 - http://lists.fedoraproject.org/pipermail/users/2010-June/374931.html
349 In guestfish, specified -m non-existent filesystem. We could suggest
350 a list of filesystems, or suggest they run the virt-list-filesystems
353 Progress of long-running operations
354 -----------------------------------
356 For example, copying in virt-resize. How can we display the progress
357 of these operations? This is a basic usability requirement, and
358 frequently requested.