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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!