I’m trying to set up libvirt in a container (Alt Linux), so I made an lxc.hook.autodev script to add necessary devices:
cd ${LXC_ROOTFS_MOUNT}/dev
mknod kvm c 10 232
chown root:root kvm
chmod 0777 kvm
The problem is chown and chmod doesn’t change the owner and permissions no matter what I put there. The device always ends up like this:
crw-rw-rw- 1 root vmusers 10, 232 Mar 21 13:11 kvm
I can change permissions from inside the container without any issues. Maybe something in the container changes permissions of /dev/kvm when the container starts?