For some time now, I've been using virt-manager
to manage my virtual machines. When I want to copy a file from the host to the vm, I have been using scp
to copy via ssh
over the network. This is kind of tedious, and there must be a way to share a folder similar to VirtualBox. So how can I best share a folder between a KVM host and guest using virt-manager?
Asked
Active
Viewed 9.4k times
23

andrewsomething
- 37,412
2 Answers
8
You could use 9p sharing as described at http://www.linux-kvm.org/page/9p_virtio .
Other possibilities include usage of a network file system like NFS or CIFS/Samba.

flob
- 422
1
9p just works on QEMU KVM Ubuntu 18.04 guest/host
I'm not sure why it wasn't working before, but now it just works. I basically just add to the QEMU CLI:
-virtfs local,path=/path/to/share,mount_tag=host0,security_model=mapped,id=host0
and mount on guest as:
sudo mkdir /mnt/9p
mount -t 9p -o trans=virtio,version=9p2000.L host0 /mnt/9p
Exact setup described at: How to run Ubuntu desktop on QEMU?

Martins3
- 3

Ciro Santilli OurBigBook.com
- 28,474
/usr/bin/qemu-kvm
. What to do ? – R S Apr 04 '17 at 00:33