It has been possible for a while to use libguestfs to access a running guest by installing guestfsd in the guest.
You just have to install the new (Rawhide-only) libguestfs-live-service package inside the guest.
On the host, add the following clause to the guest’s XML:
<channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/$GUESTNAME.libguestfs' /> <target type='virtio' name='org.libguestfs.channel.0' /> </channel>
(Replace $GUESTNAME with the name of the guest. We will likely change virt-install to make the above automatic.)
Update: librarian points out that you need qemu ≥ 0.14, and you also need to change the machine type to
pc-0.14, otherwise virtio-serial sockets are not supported.
You can now connect using guestfish, eg:
# guestfish --live -d FedoraRawhidex64 Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell ><fs> run ><fs> lvs /dev/vg_fedorarawhidex64/lv_root /dev/vg_fedorarawhidex64/lv_swap ><fs> touch /tmp/foo
A word of warning: Trying to edit disk images which are in use by virtual machines is dangerous and will result in disk corruption. libguestfs live works quite differently — it talks to the daemon running inside the guest and the daemon makes the changes safely.