Answer the question
In order to leave comments, you need to log in
How can I forward devices to an lxc container when the container is running?
On the host, I have a device in /dev that I forward to the container, but there is a symbolic link to this device in another /dev directory, which is created using udev (maybe I don’t understand udev well).
The lxc config says:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir
lxc.mount.entry: / dev/xxx/xxx dev/xxx/xxx none bind,optional,create=dir
At startup, the device is forwarded, but if you remove and insert usb into the host, the device appears on the host, and appears in the container only in / dev / bus / usb. And the symbolic link with which the service works does not appear in /dev/xxx/xxx. You have to restart the container to make everything work in it, but is it possible to forward a new /dev/xxx/xxx in a running container?
Answer the question
In order to leave comments, you need to log in
The device can be connected to the container with the lxc-device command on the host. For example: lxc-device add -n 112 /dev/ttyUSB0 /dev/ttyUSB0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question