on the host:
➜ tmp>echo foo > share1/bar ➜ tmp>echo foo > share2/bar ➜ tmp>ls -la share* share1: total 4 drwxrwxr-x 1 muelli muelli 6 Apr 24 11:22 ./ drwxrwxr-x 1 muelli muelli 30 Apr 24 11:17 ../ -rw-rw-r-- 1 muelli muelli 4 Apr 24 11:28 bar
share2: total 4 drwxrwxr-x 1 muelli muelli 6 Apr 24 11:22 ./ drwxrwxr-x 1 muelli muelli 30 Apr 24 11:17 ../ -rw-rw-r-- 1 muelli muelli 4 Apr 24 11:28 bar ➜ tmp>pwd /home/muelli/tmp ➜ tmp>
and then on the guest:
root@ubuntu:~# mkdir /tmp/mnt1 root@ubuntu:~# mkdir /tmp/mnt2 root@ubuntu:~# mount /hostshare1 -t 9p -o trans=virtio,version9p2000.L,access=any,posixacl /tmp/mnt1/ root@ubuntu:~# mount /hostshare2 -t 9p -o trans=virtio,version9p2000.L,access=any,posixacl /tmp/mnt2/ root@ubuntu:~# ls -la /tmp/mnt*/ /tmp/mnt1/: total 8 drwxrwxr-x 1 foo foo 6 Apr 24 11:22 . drwxrwxrwt 4 root root 4096 Apr 24 11:27 .. -rw-rw-r-- 1 foo foo 4 Apr 24 11:28 bar
/tmp/mnt2/: total 8 drwxrwxr-x 1 foo foo 6 Apr 24 11:22 . drwxrwxrwt 4 root root 4096 Apr 24 11:27 .. -rw-rw-r-- 1 foo foo 4 Apr 24 11:28 bar root@ubuntu:~# cat /tmp/mnt*/bar foo foo root@ubuntu:~# echo baz > /tmp/mnt1/baz -bash: /tmp/mnt1/baz: Permission denied root@ubuntu:~# echo baz > /tmp/mnt2/baz -bash: /tmp/mnt2/baz: Permission denied
so reading seems to work, but writing not. I can imagine that to be a problem with the permissions of the folder being written to. However, changing the group of the folders to libvirtd didn't help.
on the host:
➜ tmp>echo foo > share1/bar
➜ tmp>echo foo > share2/bar
➜ tmp>ls -la share*
share1:
total 4
drwxrwxr-x 1 muelli muelli 6 Apr 24 11:22 ./
drwxrwxr-x 1 muelli muelli 30 Apr 24 11:17 ../
-rw-rw-r-- 1 muelli muelli 4 Apr 24 11:28 bar
share2:
total 4
drwxrwxr-x 1 muelli muelli 6 Apr 24 11:22 ./
drwxrwxr-x 1 muelli muelli 30 Apr 24 11:17 ../
-rw-rw-r-- 1 muelli muelli 4 Apr 24 11:28 bar
➜ tmp>pwd
/home/muelli/tmp
➜ tmp>
and then on the guest:
root@ubuntu:~# mkdir /tmp/mnt1 version9p2000. L,access= any,posixacl /tmp/mnt1/ version9p2000. L,access= any,posixacl /tmp/mnt2/
root@ubuntu:~# mkdir /tmp/mnt2
root@ubuntu:~# mount /hostshare1 -t 9p -o trans=virtio,
root@ubuntu:~# mount /hostshare2 -t 9p -o trans=virtio,
root@ubuntu:~# ls -la /tmp/mnt*/
/tmp/mnt1/:
total 8
drwxrwxr-x 1 foo foo 6 Apr 24 11:22 .
drwxrwxrwt 4 root root 4096 Apr 24 11:27 ..
-rw-rw-r-- 1 foo foo 4 Apr 24 11:28 bar
/tmp/mnt2/:
total 8
drwxrwxr-x 1 foo foo 6 Apr 24 11:22 .
drwxrwxrwt 4 root root 4096 Apr 24 11:27 ..
-rw-rw-r-- 1 foo foo 4 Apr 24 11:28 bar
root@ubuntu:~# cat /tmp/mnt*/bar
foo
foo
root@ubuntu:~# echo baz > /tmp/mnt1/baz
-bash: /tmp/mnt1/baz: Permission denied
root@ubuntu:~# echo baz > /tmp/mnt2/baz
-bash: /tmp/mnt2/baz: Permission denied
so reading seems to work, but writing not. I can imagine that to be a problem with the permissions of the folder being written to. However, changing the group of the folders to libvirtd didn't help.