[Please remember to post all questions on the mailing list] On Thu, Mar 08, 2012 at 09:41:19PM +0700, Tho Huynh wrote:> Can I mount the guest's file system into a folder/path (mountpoint) > in the host machine using guestfish?No, but you don't need to.> And accessing that folder equal to accessing the guest's file > system. What I'm trying to do is to copy a file from one guest to > another directly but to achieve full disk speed.Guestfish cannot connect to two guests at the same time, so you would need to download the file from one guest and upload it to the other. (I'm still assuming here that you are using libguestfs live). eg: guestfish --live -d Source download /some/file /tmp/file guestfish --live -d Destination upload /tmp/file /some/file If that isn't fast enough or you need to avoid the local copy, it is possible to connect two handles together and copy the file directly between them, but you'd have to write a script against the API (eg. in Perl/Python/etc). . . . In the *non-live* case, there is another method: add the disks of both guests, 'launch', and copy the file between mountpoints (see the 'mkmountpoint' command). Surprisingly, this is not necessarily going to be faster than downloading and uploading. This method also has some limitations -- it's not possible to use two guests that have conflicting volume group names; and even security issues -- a malicious guest could interfere with the other guest. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
hi Mr Rich. I`m new to programming on Linux, new to Perl, Python. How long do you think it will take me to finish the script ? Thank you. Comment if you have time :) ________________________________ From: Richard W.M. Jones <rjones at redhat.com> To: Tho Huynh <feeliwood at yahoo.com>; libguestfs at redhat.com Sent: Friday, 9 March 2012, 1:23 Subject: Re: mounting using guestfish [Please remember to post all questions on the mailing list] On Thu, Mar 08, 2012 at 09:41:19PM +0700, Tho Huynh wrote:> Can I mount the guest's file system into a folder/path (mountpoint) > in the host machine using guestfish?No, but you don't need to.> And accessing that folder equal to accessing the guest's file > system.? What I'm trying to do is to copy a file from one guest to > another directly but to achieve full disk speed.Guestfish cannot connect to two guests at the same time, so you would need to download the file from one guest and upload it to the other. (I'm still assuming here that you are using libguestfs live).? eg: ? guestfish --live -d Source download /some/file /tmp/file ? guestfish --live -d Destination upload /tmp/file /some/file If that isn't fast enough or you need to avoid the local copy, it is possible to connect two handles together and copy the file directly between them, but you'd have to write a script against the API (eg. in Perl/Python/etc). ??? .? .? . In the *non-live* case, there is another method: add the disks of both guests, 'launch', and copy the file between mountpoints (see the 'mkmountpoint' command).? Surprisingly, this is not necessarily going to be faster than downloading and uploading.? This method also has some limitations -- it's not possible to use two guests that have conflicting volume group names; and even security issues -- a malicious guest could interfere with the other guest. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine.? Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20120308/9a318969/attachment.htm>
On Fri, Mar 09, 2012 at 01:11:23AM -0800, THO HUYNH wrote:> Do you have any documentation about the implementation of mounting > using guestfish. I want to know how it works inside then write the > script.Libguestfs live access works slightly differently from ordinary use of libguestfs, and all the examples only explain the ordinary way. The main documentation is here: http://libguestfs.org/guestfs.3.html#api_overview Once you've decided what language you want to use, you'll need to follow one of these pages: http://libguestfs.org/guestfs-perl.3.html http://libguestfs.org/guestfs-python.3.html http://libguestfs.org/guestfs-ocaml.3.html http://libguestfs.org/guestfs-ruby.3.html http://libguestfs.org/guestfs-java.3.html Because it's live, you need to add the domain using the 'live' option, see: http://libguestfs.org/guestfs.3.html#guestfs_add_domain To download and upload between handles, you'll need to use two threads, a pipe between them, and the regular download/upload APIs: http://libguestfs.org/guestfs.3.html#guestfs_download http://libguestfs.org/guestfs.3.html#guestfs_upload http://libguestfs.org/guestfs.3.html#guestfs_tar_out http://libguestfs.org/guestfs.3.html#guestfs_tar_in (etc) I suggest writing some code and reading the many programs in the source of libguestfs, and if you get stuck, posting specific questions on the mailing list. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Maybe Matching Threads
- copy file from host to live guest (speed)
- trouble compiling libguestfs 1.17.21
- Can I use guestfish to benchmark qemu performance?
- Re: Guestfish command - "copy-out" not working for symbolic links
- Re: Guestfish command - "copy-out" not working for symbolic links