guestfish -i now decrypts encrypted guests

$ guestfish --ro -i /tmp/encrypted.img
Enter key or passphrase ("/dev/vda2"): ***

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

Operating system: Fedora release 13 (Goddard)
/dev/vg_f13x64encrypted/lv_root mounted on /
/dev/vda1 mounted on /boot


I was asked yesterday how to use these features direct from the API. The simplest thing is probably to add the guestfish -x option which will trace out all the API calls that guestfish uses, eg:

$ guestfish --ro -x -i /tmp/encrypted.img
add_drive_opts "/tmp/encrypted.img" "readonly:true"
vfs_type "/dev/vda1"
vfs_type "/dev/vda2"
Enter key or passphrase ("/dev/vda2"): ***
luks_open "/dev/vda2" "***" "luksvda2"
vg_activate_all true

and you can use the same API calls from your own program.


Leave a comment

Filed under Uncategorized

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.