Skip to content

Instantly share code, notes, and snippets.

@4piu
Created August 6, 2026 04:28
Show Gist options
  • Select an option

  • Save 4piu/189e727c9a8c9e96220183f6822edc35 to your computer and use it in GitHub Desktop.

Select an option

Save 4piu/189e727c9a8c9e96220183f6822edc35 to your computer and use it in GitHub Desktop.
Allow LXC container to play audio using host device
# Audio Configuration
# Create a file on host: /etc/udev/rules.d/99-lxc-audio.rules
# ACTION=="add", SUBSYSTEM=="sound", ENV{DEVNAME}!="", RUN+="/usr/bin/setfacl -m u:101000:rw $env{DEVNAME}"
# EOF
# Replace 101000 with the your mapped user ID for unprivileged container
# !!! This rule must be executed after 73-seat-late.rules !!!
lxc.cgroup2.devices.allow = c 116:* rwm
lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir
lxc.mount.entry = tmpfs run tmpfs rw,nosuid,nodev,mode=0755,size=20%,nr_inodes=800k,create=dir
lxc.mount.entry = /run/udev/data run/udev/data none bind,ro,create=dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment