I use 9p mainly because of ZFS. ZFS over NFS uses ZFS sync.
This means the writes are completed to disk before they're written.... instead of being written into ZFS RAM. If you disabled ZFS sync over NFS, you'll will lose 5 seconds or so of writes on a power failure. No biggie, but why bother -- 9p works great!
## Proxmox Passthrough Host Storage to VM
After you have a working VM, let's say you need to get to an area on the host.
Dont want to use NFS, SMB to give access to local host data?
Try using 9p to passthrough the datashare you want!
[Documentation/9psetup]
### Loading 9p on Proxmox
ONLY WORKS ON DEBIAN:
Add to this file so that the initial filesystem can load the new kernel modules you wanted:
`nano /etc/initramfs-tools/modules`
```
9p
9pnet
9pnet_virtio
```
With those added above (someone commented you only need the last one on newer versions of debain), your fstab should work and automount the new 9p filesystem.
After you **MAKE SURE TO**:
`sudo update-initramfs -u`
### Modify the VMs config to passthrough a path we specify using 9p virtfs
To do this we have to edit the VM's config. There is no GUI option to make this work.
Open `/etc/pve/qemu-server/<vmid>.conf` and add the following (substituting relevant parts for your setup):
* * *
Documentation page:
`args: -virtfs local,id=<some_id>,path=/tank,security_model=passthrough,mount_tag=<some_tag>`
Here is my example setup:
`args: -virtfs local,id=faststore9p,path=/rpool/faststore,security_model=passthrough,mount_tag=faststore9p`
**This text above was added in the .conf file -- at the top, before `cores: 2`**
* * *
#### Add the new mount to FSTAB
To make sure the mount is started everytime:
edit `/etc/fstab` to mount on boot with:
Documentation page:
`<you_mount_tag_name> <mount_point> 9p trans=virtio,rw,_netdev 0 0`
Here is my example setup:
`faststore9p /faststore 9p trans=virtio,rw,_netdev 0 0`
[SOURCE for the netdev requirement above]
## REBOOT
Great idea to reboot right about now.
This means the writes are completed to disk before they're written.... instead of being written into ZFS RAM. If you disabled ZFS sync over NFS, you'll will lose 5 seconds or so of writes on a power failure. No biggie, but why bother -- 9p works great!
## Proxmox Passthrough Host Storage to VM
After you have a working VM, let's say you need to get to an area on the host.
Dont want to use NFS, SMB to give access to local host data?
Try using 9p to passthrough the datashare you want!
[Documentation/9psetup]
### Loading 9p on Proxmox
ONLY WORKS ON DEBIAN:
Add to this file so that the initial filesystem can load the new kernel modules you wanted:
`nano /etc/initramfs-tools/modules`
```
9p
9pnet
9pnet_virtio
```
With those added above (someone commented you only need the last one on newer versions of debain), your fstab should work and automount the new 9p filesystem.
After you **MAKE SURE TO**:
`sudo update-initramfs -u`
### Modify the VMs config to passthrough a path we specify using 9p virtfs
To do this we have to edit the VM's config. There is no GUI option to make this work.
Open `/etc/pve/qemu-server/<vmid>.conf` and add the following (substituting relevant parts for your setup):
* * *
Documentation page:
`args: -virtfs local,id=<some_id>,path=/tank,security_model=passthrough,mount_tag=<some_tag>`
Here is my example setup:
`args: -virtfs local,id=faststore9p,path=/rpool/faststore,security_model=passthrough,mount_tag=faststore9p`
**This text above was added in the .conf file -- at the top, before `cores: 2`**
* * *
#### Add the new mount to FSTAB
To make sure the mount is started everytime:
edit `/etc/fstab` to mount on boot with:
Documentation page:
`<you_mount_tag_name> <mount_point> 9p trans=virtio,rw,_netdev 0 0`
Here is my example setup:
`faststore9p /faststore 9p trans=virtio,rw,_netdev 0 0`
[SOURCE for the netdev requirement above]
## REBOOT
Great idea to reboot right about now.
Last edited: