Hello.
I am trying to 'passthrough' the part of host filesystem to kvm guest.
libvirt xml:
<filesystem type='mount' accessmode='passthrough'>
<source dir='/var/guests/mail-var'/>
<target dir='mail-var'/>
</filesystem>
kvm is started from root.
After mounting in guest
mount -t 9p mail-var /mnt -o trans=virtio,version=9p2000.L
or
mount -t 9p www-var /mnt -o trans=virtio
if I try to make file or directory in guest, I have problem with permissions:
ruser@www:~# ls -ld /mnt/ruser/
drwxr-xr-x 2 ruser www-data 4096 May 28 13:13 /mnt/ruser/
ruser@www:~# ls -ld /mnt/tmp/
drwxrwxrwx 2 root root 4096 Jul 26 09:01 /mnt/tmp/
root@www:~# touch /mnt/tmp/file1
OK:
root@www:~# touch /mnt/ruser/file2
touch: cannot touch `/mnt/ruser/file2': Permission denied
root@www:~# su ruser
ruser@www:~$ touch /mnt/ruser/file3
touch: cannot touch `/mnt/ruser/file3': Permission denied
ruser@www:~$ touch /mnt/tmp/file4
touch: setting times of `/mnt/tmp/file4': No such file or directory
I have read in documentation, that in "passthrough" security model,
files are stored using the same credentials as they are created on the guest (like NFS3).
Suggest me, please, what is it:
I do something wrong, or I must update qemu-kvm or/and libvirt to recent version,
or I need to find other solution for sharing host filesystem?
Thanks. Yury
in host:
root@host:~# libvirtd --version
libvirtd (libvirt) 0.9.12
root@host:~# kvm --version
QEMU emulator version 1.1.2 (qemu-kvm-1.1.2+dfsg-6, Debian), Copyright
(c) 2003-2008 Fabrice Bellard
root@host:~# uname -a
Linux host 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
root@host:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"