I get permission denied on bindmounted HDDs within privileged LXC

johannes-z

New Member
Nov 22, 2022
14
1
3
Hello! I've created a new LXC and mounted my external USB HDD drives via bindmount. The LXC is privileged (at least I unticked `unprivileged container` at creation).
1669672852128.png

I created a system user who has absolutely no access to the mounted drives - can't even chown -> it says it's a read-only filesystem. The `root` user has access however.

Code:
$# chown -R emby /media/drive2
changing ownership of '/media/drive2/...': Read-only file system

The drives are mounted like this:

Code:
mp0: /dev/sdb2,mp=/media/drive1,mountoptions=noatime
mp1: /dev/sdc2,mp=/media/drive2,mountoptions=noatime
mp2: /dev/sdd2,mp=/media/drive3,mountoptions=noatime
mp3: /dev/sde1,mp=/media/drive4,mountoptions=noatime

I don't really know what else to do? I read bindmounts wouldn't work for an unprivileged container, but it's privileged? Weirdly I also had to follow this guide to install tailscale in an unprivileged container: https://tailscale.com/kb/1130/lxc-unprivileged/


Edit: cat /etc/pve/lxc/103.conf
Code:
arch: amd64
cores: 4
hostname: media
memory: 4096
mp0: /dev/sdb2,mp=/media/drive1,mountoptions=noatime
mp1: /dev/sdc2,mp=/media/drive2,mountoptions=noatime
mp2: /dev/sdd2,mp=/media/drive3,mountoptions=noatime
mp3: /dev/sde1,mp=/media/drive4,mountoptions=noatime
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=xxx,ip=dhcp,ip6=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-103-disk-0,size=16G
swap: 512
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
 
Last edited:

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!