[Lxc-users] Camera access inside container

vignesh kumar vigneshkumar86 at gmail.com
Thu Nov 29 07:29:49 UTC 2012


Hi Christoph,
                       Tried as you said. When the app tries to open the
device (/dev/video0) it throws an errror "Error opening /dev/video0 :
Operation not Permitted"

On Thu, Nov 29, 2012 at 11:32 AM, Christoph Willing <
cwilling at users.sourceforge.net> wrote:

> I have a different camera setup in a container but the method in your case
> should be similar, I think. In my container's /etc/fstab I have a line:
>     /dev/blackmagic/card0 /var/lib/lxc/agvideo/rootfs/dev/blackmagic/card0
> none rw,bind 0    0
> (where agvideo is the container name)
>
> You might instead need something like:
>     /dev/video0 /var/lib/lxc/agvideo/rootfs/dev/video0 none rw,bind 0  0
>
> The stab is referenced in the config file by a line:
>     lxc.mount = /var/lib/lxc/agvideo/rootfs/etc/fstab
>
> You can mknod the container's video device while it is not running -
> something like:
>   cd /var/lib/lxc/agvideo/rootfs/dev
>   mknod -m 660 video0 c 81 0
>
>
> chris
>
>
> On 29/11/2012, at 3:14 PM, vignesh kumar <vigneshkumar86 at gmail.com> wrote:
>
> Hi,
>    I have added the line as you mentioned and restarted the container as
> well. Still getting the same issue.
>
> On Wed, Nov 28, 2012 at 8:23 PM, Serge Hallyn <serge.hallyn at canonical.com>wrote:
>
>> Quoting vignesh kumar (vigneshkumar86 at gmail.com):
>> > Hi,
>> >     I am using a lxc-ubuntu container in a ubuntu 11.10 host OS. An
>> > application running in a container requires camera access . Currently
>> > I have a USB based webcam which mount as /dev/video0 in my host.I
>> > tried giving access to the device by adding the  line
>> > "lxc.cgroup.allow=c 81:0 rwm" in my lxc config file. But still getting
>>
>> this needs to be lxc.cgroup.devices.allow
>>
>> > error msg "mknod:/dev/video0 Operation not permitted" in my container.
>> > Can anyone give me a solution  in accessing camera inside a container?
>>
>> Did you stop and re-start your container after adding that line to
>> your config?
>>
>> -serge
>>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers.
> http://goparallel.sourceforge.net_______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20121129/26c6fd43/attachment.html>


More information about the lxc-users mailing list