[SOLVED] Permission issue in container with mount

Discussion in 'Proxmox VE: Installation and configuration' started by thierrybla, Apr 16, 2019.

  1. thierrybla

    thierrybla New Member

    Joined:
    Apr 15, 2019
    Messages:
    5
    Likes Received:
    0
    I have mounted my ZFS share /tank/to my container (8002) with this command:

    # pct set 8002 -mp0 /tank/,mp=/mnt/tank/

    But now when I boot up the container (running ubuntu 18.04) I don't have write permissions.

    I also can't change the permissions in anyway.

    How do I give my root user in the Ubuntu container write permissions to this mount?

    Thanks in advance.
     
  2. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,125
    Likes Received:
    91
    * please post your container's config: `pct config 8002`
    * please also post the output of:
    * `ls -la /tank` (on the host)
    * `ls -la /mnt/tank` in the container

    my first guess is that the container is unprivileged and that users inside the usernamespace do not have permissions on the directory
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. thierrybla

    thierrybla New Member

    Joined:
    Apr 15, 2019
    Messages:
    5
    Likes Received:
    0
    I attached the config and also want to say that /mnt/tank isnt /mnt/tank but it is the contents of the tank (2 folders)

    root@thierry-server:~# ls -la /tank
    total 30
    drwxrwxr-x 4 root root 4 Apr 15 18:23 .
    drwxr-xr-x 25 root root 4096 Apr 16 05:25 ..
    drwxrwxr-x 2 root root 2 Apr 16 05:27 torrents
    drwxrwxr-x 5 root root 5 Apr 15 18:32 video

    and

    root@Plex-Backend:~# ls -la /mnt/
    total 33
    drwxr-xr-x 4 root root 4096 Apr 16 04:09 .
    drwxr-xr-x 22 root root 4096 Apr 16 04:45 ..
    drwxrwxr-x 2 nobody nogroup 2 Apr 16 03:27 torrents
    drwxrwxr-x 5 nobody nogroup 5 Apr 15 16:32 video

    I can see that the 2 folders don't have a group and or user but I am not able to change this I will get an error with Permission denied. even as root.

    I hope this helps, Kind regards and thanks for the help.
     
  4. thierrybla

    thierrybla New Member

    Joined:
    Apr 15, 2019
    Messages:
    5
    Likes Received:
    0
    config I forgot, changed to .txt otherwise I couldn't upload it.
     

    Attached Files:

    • 8002.txt
      File size:
      318 bytes
      Views:
      2
  5. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,125
    Likes Received:
    91
    This looks as guessed - the container is unprivileged - if you want to pass a bind-mount you need to either create a privileged container, or you can try to change the permissions to 777 for all files (I haven't tested the second option explicitly)

    Hope this helps!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. thierrybla

    thierrybla New Member

    Joined:
    Apr 15, 2019
    Messages:
    5
    Likes Received:
    0
    Sorry to ask but I used # pct set 8002 -mp0 /tank/,mp=/mnt/tank/ how would I make it a privileged container?
     
  7. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,125
    Likes Received:
    91
    Check out the reference documentation: https://pve.proxmox.com/pve-docs/chapter-pct.html
    (the part about unprivileged containers is in 'Container Settings').

    * Changing the container type is not possible (you could try to create a backup and restore it as privileged container - but it need not work/probably would not work)
    * the easiest way to change it is creating a new container (make sure to unselect the unprivileged checkbox in the wizard, since this default changed recently)

    hope this helps!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice