1

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/

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)

Attempting to list the directory:

cd /mount
ls
ls: cannot access host: Permission denied
total 0
d???????? ? ? ?         ? host
1
  • Any ideas are still welcome... :)
    – Ya.
    Apr 12, 2014 at 17:37

1 Answer 1

2

The virtual machine manager does not set up the apparmor for 9p mounts. Therefore QEMU has no permissions to access the filesystem. These need to be added manually or apparmor disabled for the particular virtual. Look in /etc/apparmor.d/libvirt these are the automatically generated apparmor profiles. Note: the TEMPLATE is used to generate them.

It also seemed necessary to set the mode to squash instead of the default which was passthrough.

1
  • You are correct, it was the apparmor issue. I set security_driver="none" in /etc/libvirt/qemu.conf, bounced the libvirt-bin daemon and I was able to mount the host folder successfully. I'm not saying that disabling apparmor is a good longerm solution, just wanted to acknowledge the issue. Thanks.
    – Ya.
    Apr 16, 2014 at 23:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .