How to make a device node persistent in a LXC

lxc

I need /dev/fuse inside a LXC. cgroups are properly configured, i.e. I can manually create the device node and everything is fine – until I restart the container, then the node is gone. Of course I could recreate the node using a dedicated startup script, but I expect that there is a less hacky way to achieve this.

So how to do it canonically?

Best Answer

If not using systemd init inside LXC 1.x container for me works:

lxc.autodev = 0
lxc.cgroup.devices.allow = c 10:229 rwm

for /dev/fuse device created inside container:

mknod /dev/fuse c 10 229