Linux – Unable to get folder sharing to work under KVM Virtual Machine Manager

linux-kvmvirtual machine

I've created an Ubuntu VM inside my Ubuntu using Virtual Machine Manager. I'm trying to mount a host directory in guest OS but it's not working. I used the instructions provided here: http://troglobit.com/blog/2013/07/05/file-system-pass-through-in-kvm-slash-qemu-slash-libvirt/.
I have shared the host directory as "myshare".

The mount command completes silently:

mount -t 9p -o trans=virtio,version=9p2000.L,rw myshare /mnt/host

mount output looking promising:

myshare on /mnt/host type 9p (rw, trans=virtio,version=9p2000.L)

However, attempting to list the directory produces:

cd /mnt
ls
ls: cannot access host: Permission denied
total 0
d???????? ? ? ?         ? host

Best Answer

The answer can be found here:

https://askubuntu.com/questions/445193/kvm-virtual-machine-manager-sharing-folders-not-working

The person was right - it was an apparmor issue. Now I need to figure out how to configure apparmor in libvirt to allow sholder sharing but that's a whole other issue.

Related Question