this post was submitted on 04 Feb 2025
22 points (89.3% liked)

Selfhosted

41723 readers
412 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.

Resources:

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

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hi all, I'm so confused about what I'm doing wrong and couldn't find any guides/troubleshooting for my specific problem, so hoping someone here can help.

I'm setting up a new Proxmox server and trying to share a folder between 2 Ubuntu VMs - a "Fileserver" VM running the SMB server and a VM that I will be running docker on ("docker VM")

my smb.conf on the fileserver:

[pool]
     path=/mnt/mergerfs
     read only = no
     browsable = yes

my fstab entry on the VM running docker:

//192.168.0.20/pool     /mnt/pool       cifs    _netdev,credentials=/etc/.smbcredentials,uid=1000,gid=1000      0       0

On the Docker VM, I can see that the folder is mounted properly with the correct permissions for the uid/gid specified (dockeruser) and with 755 permissions, but I am unable to write to it with either dockeruser or root. Interestingly, I am able to DELETE files on the share, which is confusing the hell out of me.

If I mount is as root (no uid/gid arguments in fstab), I am able to write to it, but for "best practices" I'd like to get it working with a non-root user. Any ideas?

you are viewing a single comment's thread
view the rest of the comments
[–] erer@lemm.ee 4 points 20 hours ago (2 children)

First of all, docker is not a VM. And for your issue, don't mount file shares like that in docker. Mount the file share on the host and then add it to the container as a volume. Again, a container is not a VM. It seems like you are trying to use a container like a VM. The only reason to mount a file share inside a container it's if the app inside the container supports and can handle file shares by its own like nextcloud.

[–] user9314p@lemm.ee 3 points 19 hours ago (1 children)

I guess I should have been more clear. My "Docker VM" is an Ubuntu VM (running on the same Proxmox host as my "File server" VM) that I will be using to deploy docker containers. I am trying to mount the SMB share on the Ubuntu VM and will pass that to the containers as a volume.

[–] erer@lemm.ee 3 points 10 hours ago* (last edited 9 hours ago)

Oh ok, that makes more sense. Then just like the other person says, it's most likely a user permission error. Is your dockeruser in the docker VM the same as in the other VM? As in the same uid and guid? This week I created a NFS share to mount for a container and I created a new user in both side with the same uid and guid. I suggest you to use a high uid and guid to avoid conflicts.

Edit: I think I know what is happening. The users in the allowed users at the smb conf file are not the same as the Linux users. You have to create those users with the smbpasswd command. You probably have anonymous login enabled, so when you mount the share you are actually mounting it as an anonymous user and that's why it's read only.