Ich verwende auf einem Server KVM um virtuelle Maschinen zu verwalten. Ich verwende 9p virtio um Ordner mit den Gästen zu teilen. Dies funktioniert auch problemlos für Ordner, welche auf der ext4 Boot-Festplatte liegen. Ich habe jedoch Rechte-Probleme beim teilen von ZFS Dateisystemen auf meinem RAID-Z1 Pool names p35 mit dem Mountpoint /media/p35.
Das Definitions-XML vom KVM-Gast vm-test mit 2 Filesystem passthrough:
Code: Alles auswählen
<domain type='kvm' id='16'>
<name>vm-test</name>
...
<devices>
...
<filesystem type='mount' accessmode='mapped'>
<source dir='/var/lib/libvirt/test'/>
<target dir='/host/test'/>
<alias name='fs0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</filesystem>
<filesystem type='mount' accessmode='mapped'>
<source dir='/media/p35/testzfs'/>
<target dir='/host/testzfs'/>
<alias name='fs1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</filesystem>
...
</devices>
</domain>
Code: Alles auswählen
morrow@vm-test:~$ sudo mount -t 9p -o trans=virtio,version=9p2000.L,rw /host/test /media/test
morrow@vm-test:~$ sudo mount -t 9p -o trans=virtio,version=9p2000.L,rw /host/testzfs /media/testzfs
morrow@vm-test:~$ cd /media/
morrow@vm-test:/media$ ll
total 55K
drwxr-xr-x 5 root root 4.0K Feb 1 00:17 ./
drwxr-xr-x 22 root root 4.0K Jan 28 02:14 ../
lrwxrwxrwx 1 root root 6 Jan 28 02:13 cdrom -> cdrom0/
drwxr-xr-x 2 root root 4.0K Jan 28 02:13 cdrom0/
drwxr-xr-x 2 root root 4.0K Feb 1 01:19 test/
drwxr-s--- 11 root root 23 Jan 31 17:06 testzfs/
morrow@vm-test:/media$ ll test/
total 10G
drwxr-xr-x 2 root root 4.0K Feb 1 01:19 ./
drwxr-xr-x 5 root root 4.0K Feb 1 00:17 ../
-rw------- 1 root root 10G Jan 28 02:06 test.file
morrow@vm-test:/media$ ll testzfs/
ls: cannot open directory testzfs/: Permission denied