Connecting libguestfs to a running VM – updated

I posted some very experimental patches that let you connect libguestfs programs to a running virtual machine (running the guestfsd daemon).

This lets you list out and edit files on a live virtual machine. Below is an example, but note that in the final version it won’t be this complex — you will just use guestfish -i -d GuestName and some libvirt magic will know how to attach to the guest.

# guestfish -n \
    set-attach-method unix:/tmp/f14socket : \
    run : \
    ll / : \
    cat /etc/redhat-release
total 114
dr-xr-xr-x.  24 root root  4096 Jan 27 16:09 .
dr-xr-xr-x.  24 root root  4096 Jan 27 16:09 ..
-rw-r--r--.   1 root root     0 Jan 27 16:09 .autofsck
drwx------.   3 root root  4096 Sep 16 18:15 .dbus
dr-xr-xr-x.   2 root root  4096 Jan 27 15:28 bin
dr-xr-xr-x.   5 root root  1024 Jan 27 15:11 boot
[etc]

Fedora release 14 (Laughlin)

Inside the guest, I’m running guestfsd by hand. This is what it looks like:

# guestfsd -fvr
verbose daemon enabled
linux commmand line: ro root=/dev/mapper/vg_f13x64-lv_root rd_LVM_LV=vg_f13x64/lv_root rd_LVM_LV=vg_f13x64/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=uk rhgb quiet

ls -la /
proc 5 (ll) took 0.00 seconds
proc 4 (cat) took 0.00 seconds
read: unexpected end of file on fd 3

Update See the updated patch series.

About these ads

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s