I just posted a new libguestfs tool called virt-tar
, a sort of general purpose archiving, backup, upload and snooping tool for virtual machines.
You can use this to extract or archive directories from a guest, like this:
# virt-tar -zx someguest /home home.tar.gz
which takes a copy of /home
in the VM called someguest and saves it to a local file home.tar.gz
.
Or upload to a guest, like this:
# virt-tar -zu someguest /tmp libguestfs-1.0.73.tar.gz
which would unpack the tarball into /tmp/libguestfs-1.0.73/
inside the guest called someguest. You can’t use the upload feature on live guests.
All of the above functionality is already available through guestfish, but having a separate tool to do it makes it easier to remember for the simpler cases.
Just a usability remark. Maybe the
arguments may be modified as
follows:
virt-tar -zx guest:/home home.tar.gz
virt-tar -zu blah.tar.gz guset:/tmp
1. The host:/directory notation is
familiar from many contexts
(rcp, scp, nfs, rsync…)
2. Directionality is: from -> to
Similar to most file handling
tools.
I hope it’s not too late to break the
already “established” UI…
Oron, thanks for commenting. Yes, we worried about argument ordering too.
Unfortunately using “guest:” doesn’t work for several reasons.
We could swap the directory and tarball name in the case of uploads, but I’ll discuss on the list.