'Upload file in KVM guest

Which library is best to use for uploading a file in KVM(Kernel Based Virtual Machine) guest?



Solution 1:[1]

May be libguestfs is what you're looking for, specialy the virt-copy-in and virt-copy-out tools ?

Solution 2:[2]

If it's a linux guest, you could give 9p-virtio a try. It can share a directory between the guest and the host. http://www.linux-kvm.org/page/9p_virtio

Solution 3:[3]

This solution from David Weber works really well: http://www.linux-kvm.org/page/9p_virtio

Basically mkdir /tmp/share && echo '/hostshare /tmp/share 9p trans=virtio,version=9p2000.L 0 2' >> /etc/fstab. On Host ``mkdir /tmp/share`.

Then in Virt-manager, Add Hardware > Filesystem, change Driver to Path, add Source /tmp/share and Target /hostshare. And mount -a.

Or add by command mount -t 9p -o trans=virtio,version=9p2000.L hostshare /tmp/share.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Silopolis
Solution 2 David Weber
Solution 3 alchemy