Skip to content

Instantly share code, notes, and snippets.

@valorad
Last active November 13, 2025 16:58
Show Gist options
  • Select an option

  • Save valorad/d29a30eb4812f1cf315c3b19d4df7e3b to your computer and use it in GitHub Desktop.

Select an option

Save valorad/d29a30eb4812f1cf315c3b19d4df7e3b to your computer and use it in GitHub Desktop.
Proxmox Container Mounting

Need to login as root

Host: /etc/pve/lxc/XXX.conf

arch: amd64
cores: 1
features: nesting=1
hostname: MY_HOST_NAME
memory: 512
mp0: /path/to/dlctr,mp=/workspace/downloadCenter
net0: name=eth0,bridge=vmbr1,firewall=1,gw=10.10.10.1,hwaddr=XXXXXXXXXXXXXXXX,ip=10.10.10.10/24,type=veth
onboot: 1
ostype: alpine
rootfs: local-btrfs:XXX/vm-XXX-disk-0.raw,size=4G
swap: 512
unprivileged: 1

# uid map: from uid 0 map 1000 uids (in the ct) to the range starting 100000 (on the host), so 0..999 (ct) -> 100000..100999 (host)
##  lxc.idmap: u 0 100000 1000
##  lxc.idmap: g 0 100000 1000
# we map 2 uid starting from uid 1000 onto 1000, so 1000..1001 -> 1000..1001
##  lxc.idmap: u 1000 1000 2
##  lxc.idmap: g 1000 1000 2
# we map the rest of 65534 from 1002 upto 101001, so 1002..65535 -> 101002..165535
##  lxc.idmap: u 1002 101002 64534
##  lxc.idmap: g 1002 101002 64534

lxc.idmap: u 0 100000 1000
lxc.idmap: g 0 100000 1000
lxc.idmap: u 1000 1000 2
lxc.idmap: g 1000 1000 2
lxc.idmap: u 1002 101002 64534
lxc.idmap: g 1002 101002 64534

Host: /etc/subuid

root:100000:65536
valorad:165536:65536
# we allow 2 pieces of uid starting from 1000
root:1000:2

Host: /etc/subgid

root:100000:65536
valorad:165536:65536
# we allow 2 pieces of gid starting from 1000
root:1000:2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment