this post was submitted on 17 Jul 2024
1 points (100.0% liked)

Selfhosted

53946 readers
300 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hi, I need help to understand what I am doing wrong with my setup.

I am running a proxmox node (pve) where I have mounted my nfs storage (containing backups from my old server) on the host and assigning them to containers using pct set command.

On Host:I am setting the user permissions to the mounted folder so that the user from lxc can rw to it and the sub-folders(or atleast I thought it would be possible).

On Unpreviledged LXC:The mount is recognized and is accessible with the correct user permissions to rw

The docker container created inside the lxc is unable to read/write to this storage even though they are assigned to the correct user id 1000. The docker setup is logging errors and won't start up.

Appreciate the help!

top 3 comments
sorted by: hot top controversial new old
[–] andreas@lemmy.kfed.org 1 points 1 year ago

I run dozens of proxmox LXCs, most with docker, but can confirm that while proxmox is fantastic to host NFS shares, it is near impossible to mount external ones to LXCs without doing some weirdness on the host. best practice would be to turn the NFS into samba or something and configure the docker vms and LXCs to use that (45drives has awesome repos on GitHub that work really well; that's how I worked around that issue) the only downside is you need to usually offload everything as a backup first before the switch.

[–] Decronym@lemmy.decronym.xyz 1 points 1 year ago

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
LXC Linux Containers
NFS Network File System, a Unix-based file-sharing protocol known for performance and efficiency
RAID Redundant Array of Independent Disks for mass storage

[Thread #882 for this sub, first seen 24th Jul 2024, 09:45] [FAQ] [Full list] [Contact] [Source code]

I'll be honest man, just don't do it. I tried, I really did, to make this exact scenario to work. You can get it to work - but it will be extremely brittle. You're essentially hacking around LXC to do things it wasn't built to do, and most of it is disabling security that's there for a reason. At the end of the day you are essentially running docker directly on the host anyway, the passthrough lxc becomes less and less "there" vs passing stuff through. Then, every update to proxmox became anxiety riddled because every update would change or break something on my setup.

If you want to continue, more power to you, but I hope you heed my warnings. This is a path you will spend a lot of time on and experience a lot of frustration. Spin up a tiny debian VM and run the containers there, the overhead of the VM has been negligible, and any speedup I might have had has been made up 10x by cutting the amount of time I've had to hack proxmox to make it work.