Sharing Proxmox external HDD on home network

rollover77

New Member
Sep 19, 2023
2
0
1
Hi all,

Quite new to Linux and Proxmox especially.

I have a PVE on an old macbook in a cupboard with a Plex LXC, and have successfully mounted my external hard drive (USB into the machine running Proxmox) and passed it through to the Plex container. Plex reads the HDD fine and has generated my library.

What I am trying to do is share this HDD on my home network so I can add files to it from my desktop computer over the network.

I read elsewhere to enable SMB via Container -> Options -> Features -> enable SMB/CIFS. I've then restarted the LXC and tried connecting to it with smb://<LXC ip> but no luck.

Am I down the right path or way off?

Thanks for your help
 
I read elsewhere to enable SMB via Container -> Options -> Features -> enable SMB/CIFS. I've then restarted the LXC and tried connecting to it with smb://<LXC ip> but no luck.
That won`t turn your LXC into a SMB server. It only allows it to mount SMB shares as a client. So you need to setup a SMB server or NAS yourself. PVE doesn't come with any NAS functionalities.
And the CIFS-Feature only works for the insecure privileged LXCs. You can't directly mount SMB shares inside a more secure unprivileged LXC.

I would disk passthrough the disk into something like a OpenMediaVault VM then use OMV to share the data via SMB/NFS and then use VMs (if you care about security) or privileged LXC (if you just want less overhead ignoring security risks) for your services and mound the NFS/SMB shares there.
 
Last edited:
  • Like
Reactions: DvdNwk
That won`t turn your LXC into a SMB server. It only allows it to mount SMB shares as a client. So you need to setup a SMB server or NAS yourself. PVE doesn't come with any NAS functionalities.
And the CIFS-Feature only works for the insecure privileged LXCs. You can't directly mount SMB shares inside a more secure unprivileged LXC.

I would disk passthrough the disk into something like a OpenMediaVault VM then use OMV to share the data via SMB/NFS and then use VMs (if you care about security) or privileged LXC (if you just want less overhead ignoring security risks) for your services and mound the NFS/SMB shares there.
Thanks for your reply, I like the look of OMV

I'd need to reinstall Plex in a VM

If I wanted to keep thinks in containers (and keep them unprivileged to maintain security) could I create the shares with an OMV VM and then mount the shares to the Proxmox host ( ? in Data Center -> Storage), then bind mount them to the LXC as I have done previously? My storage setup is simple - one or two drives hosting personal files and eventually camera data to Scrypted (which I would also like to setup as an LXC) no RAID stuff.
 
Last edited:
If I wanted to keep thinks in containers (and keep them unprivileged to maintain security) could I create the shares with an OMV VM and then mount the shares to the Proxmox host ( ? in Data Center -> Storage), then bind mount them to the LXC as I have done previously?
Yes. Just keep the downsides in mind.
- annoying user/group remapping
- LXCs won't work out of the box when restored on another host or in case you ever need to reinstall PVE
- you can't migrate the LXC between nodes unless all nodes got the same user/group remapping and mounted shares

I personally don't use unprivileged LXCs anymore. If I want it secure and reliable I will use a VM which is even more secure than a unprivileged LXC. If I don't need it secure or reliable, because it is nt that imortant, in it's own DMZ and not publicly available, I can use a privileges LXC.
 
Last edited:
Here are a few suggestions for sharing a 2TB USB-C direct attached storage device with a Proxmox server:

Chop it into 2 (or more) partitions to your liking....I just cut it in half here, do your worst.
  • For the 1TB to store VMs, images, templates, etc - Pass through the device directly to Proxmox. This will allow Proxmox to use the full 1TB for storing VM disks, templates, ISO images, etc. Just plug the device into the Proxmox host and then in Proxmox go to Datacenter > Storage > Add: and select the USB disk. Format it as zfs or ext4 and mount it under /var/lib/vz for storing VM images.
  • For the 1TB CIFS share - Create a Linux VM in Proxmox and pass through the second 1TB disk to that VM. In the VM, format the disk as ext4 and mount it. Then install and configure Samba on that VM to share the mount point over the network as a CIFS share. Make sure the VM networking is bridged so it gets an IP on your LAN.
  • An alternative is using LXC containers instead of VMs. Create a privileged LXC, pass through the 1TB disk, format and mount it, then install Samba in the container to share it out. This avoids the overhead of a full VM.
  • For shared storage consider looking at solutions like Ceph, GlusterFS, or OpenZFS so both Proxmox and the CIFS server can access the same storage pool. This avoids needing to pass through individual disks.
Let me know if you have any other questions!
 

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!