- On Host(PVE), edit
/etc/pve/qemu-server/VMID.conf
args: -fsdev local,security_model=mapped,id=fsdev0,path=/path/to/share -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare
This tells qemu to create a 9pvirtio device exposing the mount_tag hostshare
(just a name to identify the mount point). That device is coupled to an fsdev named fsdev0, which specifies which portion of the host filesystem we are sharing, and in which mode.
According to the QEMU wiki, mapped
security_model,
Files are created with Qemu user credentials and the client-user's credentials are saved in extended attributes.
I think it is better to use mapped
over passthrough
- On Guest
edit /etc/fstab
, add a line
hostshare /path/to/mount 9p trans=virtio,version=9p2000.L 0 0
Then, mount -a
. Voilà!
- 9p: Could not find request transport: virtio
Add following lines to /etc/initramfs-tools/modules
# 9p
# 9pnet
9pnet_virtio
then,
sudo update-initramfs -u
I do not know if you can access 9p config via GUI and if Windows supports it. But if the host and guest OS are both Linux, you can follow the above guide.
However, I do not notice a great performance gain by 9p compared to nfs. Since 9p also uses network to share the data. I switch to nfs for compatibility reasons.