[lxc-users] Share alsa devices in lxc.
Serge Hallyn
serge.hallyn at ubuntu.com
Mon Jun 1 16:24:54 UTC 2015
https://bmullan.wordpress.com/2013/11/20/how-to-enable-sound-in-lxc-linux-containers/
Quoting Oz Dror (odror7 at gmail.com):
> Is it possible to used alsa devices in lxc.
>
> in my config file I have ( allow access to the sound devices)
>
> lxc.cgroup.devices.allow = c 116:* rwm
>
> Before the container starts
>
> I create the /dev/snd devices
>
>
> cd ${LXC_ROOTFS_MOUNT}
> mkdir ./dev/snd
> cd ./dev/snd
> mknod -m 666 controlC0 c 116 2
> mknod -m 666 controlC1 c 116 11
> mknod -m 666 controlC2 c 116 8
> mknod -m 666 hwC0D0 c 116 7
> mknod -m 666 hwC1D0 c 116 16
> mknod -m 666 pcmC0D0c c 116 4
> mknod -m 666 pcmC0D0p c 116 3
> mknod -m 666 pcmC0D1p c 116 5
> mknod -m 666 pcmC0D2c c 116 6
> mknod -m 666 pcmC1D3p c 116 12
> mknod -m 666 pcmC1D7p c 116 13
> mknod -m 666 pcmC1D8p c 116 14
> mknod -m 666 pcmC1D9p c 116 15
> mknod -m 666 pcmC2D0c c 116 10
> mknod -m 666 pcmC2D0p c 116 9
> mknod -m 666 seq c 116 1
> mknod -m 666 timer c 116 33
>
> the lxc correctly list the devices with aplay -l or aplay -L
>
> But when I try to play a file
>
> aplay -D ....
>
> I get an error message. The device is not accessible.
>
> Is there anything else that I need to do. Are there any additional
> permissions.
>
> Thanks
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
More information about the lxc-users
mailing list