- Prep Check if 9pnet_virtio module is loded using the command
modinfo 9pnet_virtio
if it's not loaded check trouble shooting step 1. below
- 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
Though it is recomended to add some parameters
hostshare /path/to/share 9p trans=virtio,version=9p2000.L,posixacl,msize=104857600,cache=mmap 0 0
Note: The mount point needs to be created first before
Then, mount -a
. Voilà!
- 9p: Could not find request transport: virtio
Add following lines to /etc/initramfs-tools/modules
on the guest
# 9p
# 9pnet
9pnet_virtio
then,
sudo update-initramfs -u