I am running a VM on a Linux host using qemu+kvm and libvirt, the guest system is CentOS 7. I wish to share a folder between the two such that host:/some/dir becomes accessible as guest:/some/other/dir.

I wish to minimise effort and cannot re-compile the kernel on either side. I experimented with plan9 but cannot get it to run (the p9 dkms module won't compile on the CentOS 7 guest).

There must be a better way? Performance is secondary as it does not work at all right now.


Just set up sshfs/samba/nfs/etc, it's easier and it just works

EDIT: The point here is, just use a regular file share between the host and the VM, there is absolutely no need to go into dirty untested hacks like plan9.

  • I'm not entirely sure it doesn't answer the question, but it should probably be edited to provide a more complete answer. Aug 15 '16 at 15:58
  • This does provide an answer, the o/p wanted a way to share a directory between the VM and the host. I'm not sure full instructions on how to set up a file share or every sort imaginable will be feasible in this context, the point of the answer is to just say "use a regular file share".
    – dyasny
    Aug 15 '16 at 16:14
  • Thanks, this could be a solution (but isn't, yet). I already have Samba running but services on the host should not be accessible by the guest. Maybe qemu's built-in Samba server could be an option? I searched but could not find a way to enable it using libvirt/virsh's XML config file.
    – Ned64
    Aug 16 '16 at 7:19
  • Built in samba server in QEMU? Since when?
    – dyasny
    Aug 16 '16 at 13:07
  • @dyasny My source: unix.stackexchange.com/questions/165554/… but there is no XML config file equivalent, and I could not generate one so far. Documentation is hard to come by.
    – Ned64
    Aug 16 '16 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.