How to have shared storage between containers/VMs?

kikao

New Member
Apr 5, 2022
5
0
1
Is there a way to mount a directory that lives on a disk on the proxmox host and into a container or VM?

What I mean is that I have a directory /mnt/tank/whatever on the proxmox host (ZFS dataset), and I'd like that directory to be accessible at /whatever from within a container or a VM on the proxmox host. Files are then visible from both sides.

I couldn't find a way to achieve this in the interface and I don't want to use SMB or NFS because it only needs to be local.
 
Is there a way to mount a directory that lives on a disk on the proxmox host and into a container or VM?

What I mean is that I have a directory /mnt/tank/whatever on the proxmox host (ZFS dataset), and I'd like that directory to be accessible at /whatever from within a container or a VM on the proxmox host. Files are then visible from both sides.

I couldn't find a way to achieve this in the interface and I don't want to use SMB or NFS because it only needs to be local.
For LXCs you can achieve that by using bind-mounts. But keep the UID/GID remapping in mind. See here: https://pve.proxmox.com/wiki/Unprivileged_LXC_containers

But bind-mounts won't work for VMs. There your best way is still a NFS/SMB share.