[libvirt-users] filesystem accessmode='passthrough'

Yury Goltsov gg at sbmg.ru
Fri Jul 26 06:24:52 UTC 2013


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 at www:~# ls -ld /mnt/ruser/
	drwxr-xr-x 2 ruser www-data 4096 May 28 13:13 /mnt/ruser/
	ruser at www:~# ls -ld /mnt/tmp/
	drwxrwxrwx 2 root root 4096 Jul 26 09:01 /mnt/tmp/

	root at www:~# touch /mnt/tmp/file1
		OK:
	root at www:~# touch /mnt/ruser/file2
	touch: cannot touch `/mnt/ruser/file2': Permission denied

	root at www:~# su ruser
	ruser at www:~$ touch /mnt/ruser/file3
	touch: cannot touch `/mnt/ruser/file3': Permission denied
	ruser at 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 at host:~# libvirtd --version
	libvirtd (libvirt) 0.9.12
	root at host:~# kvm --version
	QEMU emulator version 1.1.2 (qemu-kvm-1.1.2+dfsg-6, Debian), Copyright
	(c) 2003-2008 Fabrice Bellard
	root at host:~# uname -a
	Linux host 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
	root at host:~$ cat /etc/os-release 
	PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"




More information about the libvirt-users mailing list