[SOLVED] Permission issue in container with mount

thierrybla

Member
Apr 15, 2019
19
0
6
34
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.
 
* 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
 
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.
 
* 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

config I forgot, changed to .txt otherwise I couldn't upload it.
 

Attachments

  • 8002.txt
    318 bytes · Views: 81
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!
 
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!

Sorry to ask but I used # pct set 8002 -mp0 /tank/,mp=/mnt/tank/ how would I make it a privileged container?
 
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!
 
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!
Can't you simply edit 8002.conf or whatever the lxc conf is called and change 'unprivileged: 1' to 'unprivileged: 0'?
 
Can't you simply edit 8002.conf or whatever the lxc conf is called and change 'unprivileged: 1' to 'unprivileged: 0'?
That does not change the permissions of the files on disk of the container - thus it won't work.
 

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!