Skip to content

Instantly share code, notes, and snippets.

@ammgws
Last active March 12, 2025 15:57
Show Gist options
  • Save ammgws/f6834925b6dd2c31cf7a87200c9c5b4e to your computer and use it in GitHub Desktop.
Save ammgws/f6834925b6dd2c31cf7a87200c9c5b4e to your computer and use it in GitHub Desktop.
Proxmox 8.1 ~ 8.2 introduced an improved way to passthrough devices to LXC without having to do the whole idmap dance

Goal: to pass device to LXC (in this case a Coral PCI device at /dev/apex_0)

Old method:

  1. Add root:44:1 to /etc/subgid on Proxmox host
  2. Add the following to LXC conf file on Proxmox host:
lxc.cgroup2.devices.allow: c 120:0 rwm
lxc.mount.entry: /dev/apex_0 dev/apex_0 none bind,optional,create=file
lxc.idmap: u 0 100000 65536
lxc.idmap: g 0 100000 44
lxc.idmap: g 44 44 1
lxc.idmap: g 45 100045 65491

New method introduced in Proxmox 8.1 and newer:

  1. Add dev0: /dev/apex_0,gid=44 to LXC conf file on Proxmost host. That easy!!!

NOTE 1 - This can also be done via the web interface on Proxmox 8.2 and newer:

image

NOTE 2 - If the device supports it then can add that line to multiple LXC to passthrough to more than one LXC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment